Nautobot NetBox Importer Package¶
nautobot_netbox_importer
¶
App declaration for nautobot_netbox_importer.
NautobotNetboxImporterConfig
¶
Bases: NautobotAppConfig
App configuration for the nautobot_netbox_importer app.
Source code in nautobot_netbox_importer/__init__.py
base
¶
Base types for the Nautobot Importer.
register_generator_setup(module)
¶
Register adapter setup function.
This function must be called before the adapter is used and containing module can't import anything from Nautobot.
Source code in nautobot_netbox_importer/base.py
command_utils
¶
Utility functions and classes for nautobot_netbox_importer.
LogRenderer
¶
Class for rendering structured logs to the console in a human-readable format.
Example
19:48:19 Apparent duplicate object encountered? duplicate_id: {'group': None, 'name': 'CR02.CHI_ORDMGMT', 'site': {'name': 'CHI01'}, 'vid': 1000} model: vlan pk_1: 3baf142d-dd90-4379-a048-3bbbcc9c799c pk_2: cba19791-4d59-4ddd-a5c9-d969ec3ed2ba
Source code in nautobot_netbox_importer/command_utils.py
__call__(logger, name, event_dict)
¶
Render the given event_dict to a string.
Source code in nautobot_netbox_importer/command_utils.py
enable_logging(verbosity=0, color=None)
¶
Set up structlog (as used by DiffSync) to log messages for this command.
Source code in nautobot_netbox_importer/command_utils.py
initialize_logger(options)
¶
Initialize logger instance.
Source code in nautobot_netbox_importer/command_utils.py
diffsync
¶
DiffSync adapter and model implementation for nautobot-netbox-importer.
adapters
¶
Adapter classes for loading DiffSyncModels with data from NetBox or Nautobot.
NautobotAdapter
¶
Bases: NautobotAdapter
DiffSync adapter for Nautobot.
Source code in nautobot_netbox_importer/diffsync/adapters/nautobot.py
__init__(*args, job=None, sync=None, **kwargs)
¶
Initialize Nautobot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
tuple
|
Arguments to be passed to the parent class. |
()
|
job |
object
|
Nautobot job. Defaults to None. |
None
|
sync |
object
|
Nautobot DiffSync. Defaults to None. |
None
|
**kwargs |
dict
|
Additional arguments to be passed to the parent class. |
{}
|
Source code in nautobot_netbox_importer/diffsync/adapters/nautobot.py
NetBoxAdapter
¶
Bases: SourceAdapter
NetBox Source Adapter.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
__init__(input_ref, options, job=None, sync=None, *args, **kwargs)
¶
Initialize NetBox Source Adapter.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
import_to_nautobot()
¶
Import a NetBox export file into Nautobot.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
load()
¶
Load data from NetBox.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
NetBoxImporterOptions
¶
Bases: NamedTuple
NetBox importer options.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
nautobot
¶
Nautobot Adapter for NetBox Importer.
NautobotAdapter
¶
Bases: NautobotAdapter
DiffSync adapter for Nautobot.
Source code in nautobot_netbox_importer/diffsync/adapters/nautobot.py
__init__(*args, job=None, sync=None, **kwargs)
¶Initialize Nautobot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
tuple
|
Arguments to be passed to the parent class. |
()
|
job |
object
|
Nautobot job. Defaults to None. |
None
|
sync |
object
|
Nautobot DiffSync. Defaults to None. |
None
|
**kwargs |
dict
|
Additional arguments to be passed to the parent class. |
{}
|
Source code in nautobot_netbox_importer/diffsync/adapters/nautobot.py
netbox
¶
NetBox to Nautobot Source Importer Definitions.
NetBoxAdapter
¶
Bases: SourceAdapter
NetBox Source Adapter.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
__init__(input_ref, options, job=None, sync=None, *args, **kwargs)
¶Initialize NetBox Source Adapter.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
import_to_nautobot()
¶Import a NetBox export file into Nautobot.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
load()
¶Load data from NetBox.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
NetBoxImporterOptions
¶
Bases: NamedTuple
NetBox importer options.
Source code in nautobot_netbox_importer/diffsync/adapters/netbox.py
models
¶
NetBox Importer DiffSync Models.
base
¶
NetBox to Nautobot Base Models Mapping.
setup(adapter)
¶
Map NetBox base models to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/base.py
circuits
¶
NetBox to Nautobot Circuits Models Mapping.
setup(adapter)
¶
Map NetBox circuits models to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/circuits.py
custom_fields
¶
NetBox to Nautobot Custom Fields Models Mapping.
setup(adapter)
¶
Map NetBox custom fields to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/custom_fields.py
dcim
¶
NetBox to Nautobot DCIM Models Mapping.
fix_power_feed_locations(adapter)
¶
Fix panel location to match rack location based on powerfeed.
Source code in nautobot_netbox_importer/diffsync/models/dcim.py
setup(adapter)
¶
Map NetBox DCIM models to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/dcim.py
unrack_zero_uheight_devices(adapter)
¶
Unrack devices with 0U height.
Source code in nautobot_netbox_importer/diffsync/models/dcim.py
ipam
¶
NetBox to Nautobot IPAM Models Mapping.
setup(adapter)
¶
Map NetBox IPAM models to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/ipam.py
locations
¶
NetBox Specific Locations handling.
define_location(field)
¶
Define location field for NetBox importer.
Source code in nautobot_netbox_importer/diffsync/models/locations.py
define_locations(field)
¶
Define locations field for NetBox importer.
Source code in nautobot_netbox_importer/diffsync/models/locations.py
setup(adapter)
¶
Setup locations for NetBox importer.
Source code in nautobot_netbox_importer/diffsync/models/locations.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
object_change
¶
NetBox to Nautobot Object Change Model Mapping.
setup(adapter)
¶
Map NetBox object change to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/object_change.py
virtualization
¶
NetBox to Nautobot Virtualization Models Mapping.
setup(adapter)
¶
Map NetBox virtualization models to Nautobot.
Source code in nautobot_netbox_importer/diffsync/models/virtualization.py
generator
¶
Generic Nautobot Import Library using DiffSync.
DiffSyncBaseModel
¶
Bases: DiffSyncModel
Base class for all DiffSync models.
Source code in nautobot_netbox_importer/generator/nautobot.py
create(diffsync, ids, attrs)
classmethod
¶
Create this model instance, both in Nautobot and in DiffSync.
Source code in nautobot_netbox_importer/generator/nautobot.py
update(attrs)
¶
Update this model instance, both in Nautobot and in DiffSync.
Source code in nautobot_netbox_importer/generator/nautobot.py
ImporterPass
¶
InternalFieldType
¶
Bases: Enum
Internal field types.
Source code in nautobot_netbox_importer/generator/base.py
InvalidChoiceValueIssue
¶
Bases: SourceFieldImporterIssue
Raised when an invalid choice value is encountered.
Source code in nautobot_netbox_importer/generator/source.py
__init__(field, value, replacement=NOTHING)
¶
Initialize the exception.
Source code in nautobot_netbox_importer/generator/source.py
NautobotAdapter
¶
Bases: BaseAdapter
Nautobot DiffSync Adapter.
Source code in nautobot_netbox_importer/generator/nautobot.py
PreImportResult
¶
SourceAdapter
¶
Bases: BaseAdapter
Source DiffSync Adapter.
Source code in nautobot_netbox_importer/generator/source.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
__init__(*args, get_source_data, trace_issues=False, nautobot=None, logger=None, **kwargs)
¶
Initialize the SourceAdapter.
Source code in nautobot_netbox_importer/generator/source.py
configure_model(content_type, nautobot_content_type='', extend_content_type='', identifiers=None, fields=None, default_reference=None, flags=None, nautobot_flags=None, pre_import=None, disable_related_reference=None, forward_references=None)
¶
Create if not exist and configure a wrapper for a given source content type.
Create Nautobot content type wrapper as well.
Source code in nautobot_netbox_importer/generator/source.py
disable_model(content_type, disable_reason)
¶
get_imported_nautobot_wrappers()
¶
Get a list of Nautobot model wrappers in the order of import.
Source code in nautobot_netbox_importer/generator/source.py
get_nautobot_content_type_uid(content_type)
¶
Get the Django content type ID for a given content type.
Source code in nautobot_netbox_importer/generator/source.py
get_or_create_wrapper(value)
¶
Get a source Wrapper for a given content type.
Source code in nautobot_netbox_importer/generator/source.py
import_data()
¶
Import data from the source.
Source code in nautobot_netbox_importer/generator/source.py
load()
¶
post_import()
¶
Post import processing.
Source code in nautobot_netbox_importer/generator/source.py
summarize(diffsync_summary)
¶
Summarize the import.
Source code in nautobot_netbox_importer/generator/source.py
SourceField
¶
Source Field.
Source code in nautobot_netbox_importer/generator/source.py
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 |
|
nautobot: NautobotField
property
¶
Get the Nautobot field wrapper.
__init__(wrapper, name, source)
¶
Initialize the SourceField.
Source code in nautobot_netbox_importer/generator/source.py
__str__()
¶
add_issue(issue_type, message, target=None)
¶
Add an importer issue to the Nautobot Model Wrapper.
Source code in nautobot_netbox_importer/generator/source.py
create_importer()
¶
Create importer for the field.
Source code in nautobot_netbox_importer/generator/source.py
disable(reason)
¶
get_source_value(source)
¶
Get a value from the source data, returning a default value if the value is empty.
Source code in nautobot_netbox_importer/generator/source.py
get_summary()
¶
Get a summary of the field.
Source code in nautobot_netbox_importer/generator/source.py
handle_sibling(sibling, nautobot_name='')
¶
Specify, that this field importer handles other field.
Source code in nautobot_netbox_importer/generator/source.py
set_choice_importer()
¶
Set a choice field importer.
Source code in nautobot_netbox_importer/generator/source.py
set_content_type_importer()
¶
Set a content type importer.
Source code in nautobot_netbox_importer/generator/source.py
set_content_types_importer()
¶
Set a content types importer.
Source code in nautobot_netbox_importer/generator/source.py
set_date_importer()
¶
Set a date importer.
Source code in nautobot_netbox_importer/generator/source.py
set_datetime_importer()
¶
Set a datetime importer.
Source code in nautobot_netbox_importer/generator/source.py
set_definition(definition)
¶
Customize field definition.
Source code in nautobot_netbox_importer/generator/source.py
set_importer(importer=None, nautobot_name='', override=False)
¶
Sets the importer and Nautobot field if not already specified.
If nautobot_name
is not provided, the field name is used.
Passing None to nautobot_name
indicates that there is custom mapping without a direct relationship to a Nautobot field.
Source code in nautobot_netbox_importer/generator/source.py
set_integer_importer()
¶
Set an integer field importer.
Source code in nautobot_netbox_importer/generator/source.py
set_json_importer()
¶
Set a JSON field importer.
Source code in nautobot_netbox_importer/generator/source.py
set_m2m_importer(related_source=None)
¶
Set a many to many importer.
Source code in nautobot_netbox_importer/generator/source.py
set_nautobot_field(nautobot_name='')
¶
Set a Nautobot field name for the field.
Source code in nautobot_netbox_importer/generator/source.py
set_nautobot_value(target, value)
¶
Set a value to the Nautobot model.
Source code in nautobot_netbox_importer/generator/source.py
set_relation_and_type_importer(type_field)
¶
Set a relation UUID importer based on the type field.
Source code in nautobot_netbox_importer/generator/source.py
set_relation_importer(related_source=None)
¶
Set a relation importer.
Source code in nautobot_netbox_importer/generator/source.py
set_status_importer()
¶
Set a status importer.
Source code in nautobot_netbox_importer/generator/source.py
set_uuid_importer()
¶
Set an UUID importer.
Source code in nautobot_netbox_importer/generator/source.py
set_value_importer()
¶
Set a value importer.
Source code in nautobot_netbox_importer/generator/source.py
SourceFieldImporterIssue
¶
Bases: NetBoxImporterException
Raised when an error occurs during field import.
Source code in nautobot_netbox_importer/generator/source.py
SourceModelWrapper
¶
Definition of a source model mapping to Nautobot model.
Source code in nautobot_netbox_importer/generator/source.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 |
|
__init__(adapter, content_type, nautobot_wrapper)
¶
Initialize the SourceModelWrapper.
Source code in nautobot_netbox_importer/generator/source.py
__str__()
¶
add_field(name, source)
¶
Add a field definition for a source field.
Source code in nautobot_netbox_importer/generator/source.py
add_reference(related_wrapper, uid)
¶
Add a reference from this content type to related record.
Source code in nautobot_netbox_importer/generator/source.py
cache_record(data)
¶
Cache data for optional later use.
If record is referenced by other models, it will be imported automatically; otherwise, it will be ignored.
Source code in nautobot_netbox_importer/generator/source.py
cache_record_uids(source, nautobot_uid=None)
¶
Cache record identifier mappings.
When nautobot_uid
is not provided, it is generated from the source data and caching is processed there.
Source code in nautobot_netbox_importer/generator/source.py
create_importers()
¶
Create importers for all fields.
Source code in nautobot_netbox_importer/generator/source.py
disable_field(field_name, reason)
¶
Disable field importing.
first_pass(data)
¶
Firts pass of data import.
Source code in nautobot_netbox_importer/generator/source.py
format_field_name(name)
¶
get_default_reference_uid()
¶
Get the default reference to this model.
get_or_create(uid, fail_missing=False)
¶
Get an existing DiffSync Model instance from the source or create a new one.
Use Nautobot data as defaults if available.
Source code in nautobot_netbox_importer/generator/source.py
get_pk_from_data(data)
¶
Get a source primary key for a given source data.
Source code in nautobot_netbox_importer/generator/source.py
get_pk_from_identifiers(data)
¶
Get a source primary key for a given source identifiers.
Source code in nautobot_netbox_importer/generator/source.py
get_pk_from_uid(uid)
¶
Get a source primary key for a given source uid.
Source code in nautobot_netbox_importer/generator/source.py
get_summary(content_type_id)
¶
Get a summary of the model.
Source code in nautobot_netbox_importer/generator/source.py
import_record(data, target=None)
¶
Import a single item from the source.
Source code in nautobot_netbox_importer/generator/source.py
post_import()
¶
Post import processing.
Assigns referenced content_types to referencing instances.
Returns False if no post processing is needed, otherwise True to indicate that post processing is needed.
Source code in nautobot_netbox_importer/generator/source.py
second_pass(data)
¶
Second pass of data import.
Source code in nautobot_netbox_importer/generator/source.py
set_default_reference(data)
¶
set_identifiers(identifiers)
¶
Set identifiers for the model.
Source code in nautobot_netbox_importer/generator/source.py
SourceRecord
¶
base
¶
Generic DiffSync Importer base module.
BaseAdapter
¶
Bases: DiffSync
Base class for Generator Adapters.
Source code in nautobot_netbox_importer/generator/base.py
InternalFieldType
¶
Bases: Enum
Internal field types.
Source code in nautobot_netbox_importer/generator/base.py
get_nautobot_field_and_type(model, field_name)
¶
Get Nautobot field and internal field type.
Source code in nautobot_netbox_importer/generator/base.py
normalize_datetime(value)
¶
Normalize datetime values to UTC to compare with DiffSync.
Source code in nautobot_netbox_importer/generator/base.py
source_pk_to_uuid(content_type, pk, namespace=uuid5(UUID('33c07af8-e425-43b2-b8d0-52289dfe7cf2'), settings.SECRET_KEY))
¶
Deterministically map source primary key to a UUID primary key.
One of the reasons Nautobot moved from sequential integers to UUIDs was to protect the application against key-enumeration attacks, so we don't use a hard-coded mapping from integer to UUID as that would defeat the purpose.
Source code in nautobot_netbox_importer/generator/base.py
exceptions
¶
Custom exceptions for the NetBox Importer.
NautobotModelNotFound
¶
Bases: NetBoxImporterException
Raised when a Nautobot model cannot be found.
fields
¶
Generic Field Importers definitions for Nautobot Importer.
constant(value, nautobot_name='')
¶
Create a constant field definition.
Use to fill target constant value for the field.
Source code in nautobot_netbox_importer/generator/fields.py
default(default_value, nautobot_name='')
¶
Create a default field definition.
Use to set a default value for the field, if there is no value in the source data.
Source code in nautobot_netbox_importer/generator/fields.py
disable(reason)
¶
Disable the field.
Use to disable the field import with the given reason.
Source code in nautobot_netbox_importer/generator/fields.py
fallback(value=None, callback=None, nautobot_name='')
¶
Create a fallback field definition.
Use to set a fallback value or callback for the field, if there is an error during the default importer.
Source code in nautobot_netbox_importer/generator/fields.py
force(nautobot_name='')
¶
Mark Nautobot field as forced.
Use to force the field to be saved in Nautobot in the second save attempt after the initial save to override the default value set by Nautobot.
Source code in nautobot_netbox_importer/generator/fields.py
pass_through(nautobot_name='')
¶
Create a pass-through field definition.
Use to pass-through the value from source to target without changing it by the default importer.
Source code in nautobot_netbox_importer/generator/fields.py
relation(related_source, nautobot_name='')
¶
Create a relation field definition.
Use when there is a different source content type that should be mapped to Nautobot relation.
Source code in nautobot_netbox_importer/generator/fields.py
role(adapter, source_content_type, nautobot_name='role')
¶
Create a role field definition.
Use, when there is a different source role content type that should be mapped to the Nautobot "extras.Role".
It creates a new wrapper for the source_content_type
if it does not already exist.
It also handles the scenario where the same role names are used in different role models,
e.g., RackRole with name = "Network"
and DeviceRole with name = "Network"
to avoid duplicates.
Source code in nautobot_netbox_importer/generator/fields.py
source_constant(value, nautobot_name='')
¶
Create a source constant field definition.
Use, to pre-fill constant value for the field. Calls default importer after setting the value.
Source code in nautobot_netbox_importer/generator/fields.py
nautobot
¶
Nautobot DiffSync Importer.
DiffSyncBaseModel
¶
Bases: DiffSyncModel
Base class for all DiffSync models.
Source code in nautobot_netbox_importer/generator/nautobot.py
create(diffsync, ids, attrs)
classmethod
¶
Create this model instance, both in Nautobot and in DiffSync.
Source code in nautobot_netbox_importer/generator/nautobot.py
update(attrs)
¶
Update this model instance, both in Nautobot and in DiffSync.
Source code in nautobot_netbox_importer/generator/nautobot.py
NautobotAdapter
¶
Bases: BaseAdapter
Nautobot DiffSync Adapter.
Source code in nautobot_netbox_importer/generator/nautobot.py
NautobotField
¶
Wrapper for a Nautobot field.
Source code in nautobot_netbox_importer/generator/nautobot.py
can_import: bool
property
¶
Determine if this field can be imported.
is_auto_increment: bool
property
¶
Check if the field is an integer.
is_content_type: bool
property
¶
Check if the field is a content type.
is_integer: bool
property
¶
Check if the field is an integer.
is_reference: bool
property
¶
Check if the field is a reference.
related_meta: DjangoModelMeta
property
¶
Get the Nautobot model meta.
related_model: NautobotBaseModelType
property
¶
Get the related model for a reference field.
__init__(name, internal_type, field=None)
¶
Initialize the wrapper.
Source code in nautobot_netbox_importer/generator/nautobot.py
NautobotModelWrapper
¶
Wrapper for a Nautobot model.
Source code in nautobot_netbox_importer/generator/nautobot.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
|
content_type_instance: ContentType
property
¶
Get the Nautobot content type instance for a given content type.
diffsync_class: Type[DiffSyncBaseModel]
property
¶
Get DiffSyncModel
class for this wrapper.
model: NautobotBaseModelType
property
¶
Get the Nautobot model.
model_meta: DjangoModelMeta
property
¶
Get the Nautobot model meta.
pk_field: NautobotField
property
¶
Get the pk field.
__init__(adapter, content_type)
¶
Initialize the wrapper.
Source code in nautobot_netbox_importer/generator/nautobot.py
__str__()
¶
add_field(field_name)
¶
Add a field to the model.
Source code in nautobot_netbox_importer/generator/nautobot.py
add_issue(issue_type='', message='', uid='', data=None, diffsync_instance=None, nautobot_instance=None, error=None, nautobot_name='')
¶
Add a new importer issue.
This function register an issue and returns the issue object. All input arguments are optional, internal logic tries to fill in as much information as possible based on the arguments provided.
It can be called in any import stage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
issue_type |
Optional[str]
|
The type of the issue, e.g. "SaveFailed". Can be determined from |
''
|
message |
Optional[str]
|
A message to be included in the issue. Can be determined from |
''
|
uid |
Optional[Uid]
|
The UID of the instance that caused the issue. Can be determined from instances. |
''
|
data |
Optional[Mapping]
|
The data that caused the issue. |
None
|
diffsync_instance |
Optional[DiffSyncModel]
|
The DiffSync instance that caused the issue. |
None
|
nautobot_instance |
Optional[NautobotBaseModel]
|
The Nautobot instance that caused the issue. |
None
|
error |
Optional[Exception]
|
The error that caused the issue. |
None
|
nautobot_name |
Optional[str]
|
The name of the Nautobot instance that caused the issue. This is determined after the import, before creating summaries. |
''
|
Examples can be found by looking at calls to this function in the code.
Source code in nautobot_netbox_importer/generator/nautobot.py
find_or_create(identifiers_kwargs)
¶
Find a DiffSync instance based on filter kwargs or create a new instance from Nautobot if possible.
Source code in nautobot_netbox_importer/generator/nautobot.py
get_importer_issues()
¶
Get importer issues for this model.
This will also run clean
on all instances that failed clean()
after saving.
Source code in nautobot_netbox_importer/generator/nautobot.py
get_summary()
¶
Get the summary.
Source code in nautobot_netbox_importer/generator/nautobot.py
save_nautobot_instance(instance, values)
¶
Save a Nautobot instance.
Source code in nautobot_netbox_importer/generator/nautobot.py
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
|
set_instance_defaults(**defaults)
¶
source
¶
Generic DiffSync Source Generator.
ImporterPass
¶
InvalidChoiceValueIssue
¶
Bases: SourceFieldImporterIssue
Raised when an invalid choice value is encountered.
Source code in nautobot_netbox_importer/generator/source.py
__init__(field, value, replacement=NOTHING)
¶
Initialize the exception.
Source code in nautobot_netbox_importer/generator/source.py
PreImportResult
¶
SourceAdapter
¶
Bases: BaseAdapter
Source DiffSync Adapter.
Source code in nautobot_netbox_importer/generator/source.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
__init__(*args, get_source_data, trace_issues=False, nautobot=None, logger=None, **kwargs)
¶
Initialize the SourceAdapter.
Source code in nautobot_netbox_importer/generator/source.py
configure_model(content_type, nautobot_content_type='', extend_content_type='', identifiers=None, fields=None, default_reference=None, flags=None, nautobot_flags=None, pre_import=None, disable_related_reference=None, forward_references=None)
¶
Create if not exist and configure a wrapper for a given source content type.
Create Nautobot content type wrapper as well.
Source code in nautobot_netbox_importer/generator/source.py
disable_model(content_type, disable_reason)
¶
get_imported_nautobot_wrappers()
¶
Get a list of Nautobot model wrappers in the order of import.
Source code in nautobot_netbox_importer/generator/source.py
get_nautobot_content_type_uid(content_type)
¶
Get the Django content type ID for a given content type.
Source code in nautobot_netbox_importer/generator/source.py
get_or_create_wrapper(value)
¶
Get a source Wrapper for a given content type.
Source code in nautobot_netbox_importer/generator/source.py
import_data()
¶
Import data from the source.
Source code in nautobot_netbox_importer/generator/source.py
load()
¶
post_import()
¶
Post import processing.
Source code in nautobot_netbox_importer/generator/source.py
summarize(diffsync_summary)
¶
Summarize the import.
Source code in nautobot_netbox_importer/generator/source.py
SourceField
¶
Source Field.
Source code in nautobot_netbox_importer/generator/source.py
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 |
|
nautobot: NautobotField
property
¶
Get the Nautobot field wrapper.
__init__(wrapper, name, source)
¶
Initialize the SourceField.
Source code in nautobot_netbox_importer/generator/source.py
__str__()
¶
add_issue(issue_type, message, target=None)
¶
Add an importer issue to the Nautobot Model Wrapper.
Source code in nautobot_netbox_importer/generator/source.py
create_importer()
¶
Create importer for the field.
Source code in nautobot_netbox_importer/generator/source.py
disable(reason)
¶
get_source_value(source)
¶
Get a value from the source data, returning a default value if the value is empty.
Source code in nautobot_netbox_importer/generator/source.py
get_summary()
¶
Get a summary of the field.
Source code in nautobot_netbox_importer/generator/source.py
handle_sibling(sibling, nautobot_name='')
¶
Specify, that this field importer handles other field.
Source code in nautobot_netbox_importer/generator/source.py
set_choice_importer()
¶
Set a choice field importer.
Source code in nautobot_netbox_importer/generator/source.py
set_content_type_importer()
¶
Set a content type importer.
Source code in nautobot_netbox_importer/generator/source.py
set_content_types_importer()
¶
Set a content types importer.
Source code in nautobot_netbox_importer/generator/source.py
set_date_importer()
¶
Set a date importer.
Source code in nautobot_netbox_importer/generator/source.py
set_datetime_importer()
¶
Set a datetime importer.
Source code in nautobot_netbox_importer/generator/source.py
set_definition(definition)
¶
Customize field definition.
Source code in nautobot_netbox_importer/generator/source.py
set_importer(importer=None, nautobot_name='', override=False)
¶
Sets the importer and Nautobot field if not already specified.
If nautobot_name
is not provided, the field name is used.
Passing None to nautobot_name
indicates that there is custom mapping without a direct relationship to a Nautobot field.
Source code in nautobot_netbox_importer/generator/source.py
set_integer_importer()
¶
Set an integer field importer.
Source code in nautobot_netbox_importer/generator/source.py
set_json_importer()
¶
Set a JSON field importer.
Source code in nautobot_netbox_importer/generator/source.py
set_m2m_importer(related_source=None)
¶
Set a many to many importer.
Source code in nautobot_netbox_importer/generator/source.py
set_nautobot_field(nautobot_name='')
¶
Set a Nautobot field name for the field.
Source code in nautobot_netbox_importer/generator/source.py
set_nautobot_value(target, value)
¶
Set a value to the Nautobot model.
Source code in nautobot_netbox_importer/generator/source.py
set_relation_and_type_importer(type_field)
¶
Set a relation UUID importer based on the type field.
Source code in nautobot_netbox_importer/generator/source.py
set_relation_importer(related_source=None)
¶
Set a relation importer.
Source code in nautobot_netbox_importer/generator/source.py
set_status_importer()
¶
Set a status importer.
Source code in nautobot_netbox_importer/generator/source.py
set_uuid_importer()
¶
Set an UUID importer.
Source code in nautobot_netbox_importer/generator/source.py
set_value_importer()
¶
Set a value importer.
Source code in nautobot_netbox_importer/generator/source.py
SourceFieldImporterIssue
¶
Bases: NetBoxImporterException
Raised when an error occurs during field import.
Source code in nautobot_netbox_importer/generator/source.py
SourceFieldSource
¶
Bases: Enum
Defines the source of the SourceField.
Source code in nautobot_netbox_importer/generator/source.py
SourceModelWrapper
¶
Definition of a source model mapping to Nautobot model.
Source code in nautobot_netbox_importer/generator/source.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 |
|
__init__(adapter, content_type, nautobot_wrapper)
¶
Initialize the SourceModelWrapper.
Source code in nautobot_netbox_importer/generator/source.py
__str__()
¶
add_field(name, source)
¶
Add a field definition for a source field.
Source code in nautobot_netbox_importer/generator/source.py
add_reference(related_wrapper, uid)
¶
Add a reference from this content type to related record.
Source code in nautobot_netbox_importer/generator/source.py
cache_record(data)
¶
Cache data for optional later use.
If record is referenced by other models, it will be imported automatically; otherwise, it will be ignored.
Source code in nautobot_netbox_importer/generator/source.py
cache_record_uids(source, nautobot_uid=None)
¶
Cache record identifier mappings.
When nautobot_uid
is not provided, it is generated from the source data and caching is processed there.
Source code in nautobot_netbox_importer/generator/source.py
create_importers()
¶
Create importers for all fields.
Source code in nautobot_netbox_importer/generator/source.py
disable_field(field_name, reason)
¶
Disable field importing.
first_pass(data)
¶
Firts pass of data import.
Source code in nautobot_netbox_importer/generator/source.py
format_field_name(name)
¶
get_default_reference_uid()
¶
Get the default reference to this model.
get_or_create(uid, fail_missing=False)
¶
Get an existing DiffSync Model instance from the source or create a new one.
Use Nautobot data as defaults if available.
Source code in nautobot_netbox_importer/generator/source.py
get_pk_from_data(data)
¶
Get a source primary key for a given source data.
Source code in nautobot_netbox_importer/generator/source.py
get_pk_from_identifiers(data)
¶
Get a source primary key for a given source identifiers.
Source code in nautobot_netbox_importer/generator/source.py
get_pk_from_uid(uid)
¶
Get a source primary key for a given source uid.
Source code in nautobot_netbox_importer/generator/source.py
get_summary(content_type_id)
¶
Get a summary of the model.
Source code in nautobot_netbox_importer/generator/source.py
import_record(data, target=None)
¶
Import a single item from the source.
Source code in nautobot_netbox_importer/generator/source.py
post_import()
¶
Post import processing.
Assigns referenced content_types to referencing instances.
Returns False if no post processing is needed, otherwise True to indicate that post processing is needed.
Source code in nautobot_netbox_importer/generator/source.py
second_pass(data)
¶
Second pass of data import.
Source code in nautobot_netbox_importer/generator/source.py
set_default_reference(data)
¶
set_identifiers(identifiers)
¶
Set identifiers for the model.
Source code in nautobot_netbox_importer/generator/source.py
summary
¶
Importer summary module.
FieldSummary
¶
Bases: NamedTuple
Field summary.
Source code in nautobot_netbox_importer/summary.py
ImportSummary
¶
Import summary.
Source code in nautobot_netbox_importer/summary.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
|
data_nautobot_models: Generator[NautobotModelSummary, None, None]
property
¶
Get Nautobot models originating from data.
data_sources: Generator[SourceModelSummary, None, None]
property
¶
Get source originating from data.
__init__()
¶
dump(path, output_format='json', indent=4)
¶
Dump the summary to a file.
Source code in nautobot_netbox_importer/summary.py
get_back_mapping()
¶
Get formatted back mapping.
Source code in nautobot_netbox_importer/summary.py
get_content_types_deviations()
¶
Get formatted content types deviations.
Source code in nautobot_netbox_importer/summary.py
get_fields_mapping()
¶
Get formatted field mappings.
Source code in nautobot_netbox_importer/summary.py
get_issues()
¶
Get formatted issues.
Source code in nautobot_netbox_importer/summary.py
get_stats(caption, objects)
¶
Get formatted stats.
Source code in nautobot_netbox_importer/summary.py
get_summary()
¶
Get a summary of the import.
Source code in nautobot_netbox_importer/summary.py
load(path)
¶
Load the summary from a file.
Source code in nautobot_netbox_importer/summary.py
ImporterIssue
¶
NautobotModelStats
¶
Nautobot Model Statistics.
Source code in nautobot_netbox_importer/summary.py
NautobotModelSummary
¶
Bases: NamedTuple
Nautobot Model Summary.
Source code in nautobot_netbox_importer/summary.py
SourceModelStats
¶
Source Model Statistics.
Source code in nautobot_netbox_importer/summary.py
SourceModelSummary
¶
Bases: NamedTuple
Source Model Summary.
Source code in nautobot_netbox_importer/summary.py
serialize_to_summary(value)
¶
Serialize value to summary.
Source code in nautobot_netbox_importer/summary.py
tests
¶
Unit tests for nautobot_netbox_importer app.
test_basic
¶
Basic tests that do not require Django.
TestDocsPackaging
¶
Bases: TestCase
Test Version in doc requirements is the same pyproject.
Source code in nautobot_netbox_importer/tests/test_basic.py
test_version()
¶
Verify that pyproject.toml dev dependencies have the same versions as in the docs requirements.txt.
Source code in nautobot_netbox_importer/tests/test_basic.py
test_import
¶
Test cases for the NetBox adapter.
Tests use stored fixtures to verify that the import process works as expected.
Check the fixtures README for more details.
TestImport
¶
Bases: TestCase
Unittest for NetBox adapter.
Test cases are dynamically created based on the fixtures available for the current Nautobot version.
Source code in nautobot_netbox_importer/tests/test_import.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
setUp()
¶
Set up test environment.