Skip to content

Commit a24ef3c

Browse files
Merge pull request #1390 from dineshbaburam91/yamldict
Migrate from yamlordereddictloader to yamlloader
2 parents e23fe2d + 2d82259 commit a24ef3c

4 files changed

Lines changed: 40 additions & 40 deletions

File tree

docs/docreq.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ PyYAML>=5.1
77
paramiko>=3.5.0
88
six
99
pyserial
10-
yamlordereddictloader
10+
yamlloader
1111
pyparsing
1212
transitions

lib/jnpr/junos/command/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from importlib.util import spec_from_loader
55

66
import yaml
7-
import yamlordereddictloader
7+
from yamlloader import ordereddict
88
from jnpr.junos.factory.factory_loader import FactoryLoader
99

1010
__all__ = []
@@ -32,7 +32,7 @@ def exec_module(self, module):
3232
with open(os.path.join(os.path.dirname(__file__), mod + ".yml"), "r") as stream:
3333
try:
3434
modules = FactoryLoader().load(
35-
yaml.load(stream, Loader=yamlordereddictloader.Loader)
35+
yaml.load(stream, Loader=ordereddict.Loader)
3636
)
3737
except yaml.YAMLError as exc:
3838
raise ImportError("%s is not loaded" % mod)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ PyYAML>=5.1
77
paramiko>=3.5.0
88
six
99
pyserial
10-
yamlordereddictloader
10+
yamlloader
1111
pyparsing
1212
transitions

tests/unit/factory/test_cmdtable.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from ncclient.manager import Manager, make_device_handler
1212
from ncclient.transport import SSHSession
1313
from unittest.mock import MagicMock, patch
14-
import yamlordereddictloader
14+
from yamlloader import ordereddict
1515
from jnpr.junos.factory.factory_loader import FactoryLoader
1616
import yaml
1717
import json
@@ -49,7 +49,7 @@ def test_unstructured_cmerror(self, mock_execute):
4949
"""
5050
globals().update(
5151
FactoryLoader().load(
52-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
52+
yaml.load(yaml_data, Loader=ordereddict.Loader)
5353
)
5454
)
5555
stats = CMErrorTable(self.dev)
@@ -84,7 +84,7 @@ def test_unstructured_sysctl_oneline_op(self, mock_execute):
8484
"""
8585
globals().update(
8686
FactoryLoader().load(
87-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
87+
yaml.load(yaml_data, Loader=ordereddict.Loader)
8888
)
8989
)
9090
stats = sysctlVeriexecTable(self.dev)
@@ -125,7 +125,7 @@ def test_unstructured_cmerror_multiline_header(self, mock_execute):
125125
"""
126126
globals().update(
127127
FactoryLoader().load(
128-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
128+
yaml.load(yaml_data, Loader=ordereddict.Loader)
129129
)
130130
)
131131
stats = CMErrorTable(self.dev)
@@ -187,7 +187,7 @@ def test_view_variable(self):
187187
"""
188188
globals().update(
189189
FactoryLoader().load(
190-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
190+
yaml.load(yaml_data, Loader=ordereddict.Loader)
191191
)
192192
)
193193
stats = CMErrorTable(self.dev)
@@ -211,7 +211,7 @@ def test_view_setter_raise_exception(self):
211211
"""
212212
globals().update(
213213
FactoryLoader().load(
214-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
214+
yaml.load(yaml_data, Loader=ordereddict.Loader)
215215
)
216216
)
217217
stats = CMErrorTable(self.dev)
@@ -239,7 +239,7 @@ def test_request_pfe_rpc_not_avialable(self, mock_execute, mock_ss, mock_ssh_con
239239
"""
240240
globals().update(
241241
FactoryLoader().load(
242-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
242+
yaml.load(yaml_data, Loader=ordereddict.Loader)
243243
)
244244
)
245245
stats = CMErrorTable(self.dev)
@@ -266,7 +266,7 @@ def test_get_api_params(self, mock_execute):
266266
"""
267267
globals().update(
268268
FactoryLoader().load(
269-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
269+
yaml.load(yaml_data, Loader=ordereddict.Loader)
270270
)
271271
)
272272
stats = CMErrorTable(self.dev)
@@ -292,7 +292,7 @@ def test_cmdview_properties(self, mock_execute):
292292
"""
293293
globals().update(
294294
FactoryLoader().load(
295-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
295+
yaml.load(yaml_data, Loader=ordereddict.Loader)
296296
)
297297
)
298298
stats = CMErrorTable(self.dev).get()
@@ -326,7 +326,7 @@ def test_cmdtable_iter(self, mock_execute):
326326
"""
327327
globals().update(
328328
FactoryLoader().load(
329-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
329+
yaml.load(yaml_data, Loader=ordereddict.Loader)
330330
)
331331
)
332332
stats = FPCLinkStatTable(self.dev)
@@ -370,7 +370,7 @@ def test_title_in_view(self, mock_execute):
370370
"""
371371
globals().update(
372372
FactoryLoader().load(
373-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
373+
yaml.load(yaml_data, Loader=ordereddict.Loader)
374374
)
375375
)
376376
stats = ShowLuchipTable(self.dev)
@@ -473,7 +473,7 @@ def test_unstructured_linkstats(self, mock_execute):
473473
"""
474474
globals().update(
475475
FactoryLoader().load(
476-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
476+
yaml.load(yaml_data, Loader=ordereddict.Loader)
477477
)
478478
)
479479
stats = FPCLinkStatTable(self.dev)
@@ -517,7 +517,7 @@ def test_field_eval(self, mock_execute):
517517
"""
518518
globals().update(
519519
FactoryLoader().load(
520-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
520+
yaml.load(yaml_data, Loader=ordereddict.Loader)
521521
)
522522
)
523523
stats = XMChipStatsTable(self.dev)
@@ -536,7 +536,7 @@ def test__contains__(self, mock_execute):
536536
"""
537537
globals().update(
538538
FactoryLoader().load(
539-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
539+
yaml.load(yaml_data, Loader=ordereddict.Loader)
540540
)
541541
)
542542
stats = FPCLinkStatTable(self.dev)
@@ -635,7 +635,7 @@ def test_unstructured_ttpstatistics(self, mock_execute):
635635
"""
636636
globals().update(
637637
FactoryLoader().load(
638-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
638+
yaml.load(yaml_data, Loader=ordereddict.Loader)
639639
)
640640
)
641641
stats = FPCTTPStatsTable(self.dev)
@@ -709,7 +709,7 @@ def test_unstructured_mtip_cge_regex(self, mock_execute):
709709
"""
710710
globals().update(
711711
FactoryLoader().load(
712-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
712+
yaml.load(yaml_data, Loader=ordereddict.Loader)
713713
)
714714
)
715715
stats = MtipCgeSummaryTable(self.dev)
@@ -803,7 +803,7 @@ def test_unstructured_icmpstats_nested(self, mock_execute):
803803
"""
804804
globals().update(
805805
FactoryLoader().load(
806-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
806+
yaml.load(yaml_data, Loader=ordereddict.Loader)
807807
)
808808
)
809809
stats = ICMPStatsTable(self.dev)
@@ -904,7 +904,7 @@ def test_unstructured_ithrottle_key_args(self, mock_execute):
904904
"""
905905
globals().update(
906906
FactoryLoader().load(
907-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
907+
yaml.load(yaml_data, Loader=ordereddict.Loader)
908908
)
909909
)
910910
stats = IthrottleIDTable(self.dev).get(target="fpc2")
@@ -945,7 +945,7 @@ def test_pci_errs_multi_key_regex(self, mock_execute):
945945
"""
946946
globals().update(
947947
FactoryLoader().load(
948-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
948+
yaml.load(yaml_data, Loader=ordereddict.Loader)
949949
)
950950
)
951951
stats = ShowPciErrorsTable(self.dev).get()
@@ -987,7 +987,7 @@ def test_fpcmemory_multi_key_columns(self, mock_execute):
987987
"""
988988
globals().update(
989989
FactoryLoader().load(
990-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
990+
yaml.load(yaml_data, Loader=ordereddict.Loader)
991991
)
992992
)
993993
stats = FPCMemory(self.dev).get()
@@ -1045,7 +1045,7 @@ def test_item_regex_pq3_pci(self, mock_execute):
10451045
"""
10461046
globals().update(
10471047
FactoryLoader().load(
1048-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1048+
yaml.load(yaml_data, Loader=ordereddict.Loader)
10491049
)
10501050
)
10511051
stats = PQ3PCITable(self.dev)
@@ -1171,7 +1171,7 @@ def test_regex_with_fields(self, mock_execute):
11711171
"""
11721172
globals().update(
11731173
FactoryLoader().load(
1174-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1174+
yaml.load(yaml_data, Loader=ordereddict.Loader)
11751175
)
11761176
)
11771177
stats = SchedulerTable(self.dev)
@@ -1208,7 +1208,7 @@ def test_exists(self, mock_execute):
12081208
"""
12091209
globals().update(
12101210
FactoryLoader().load(
1211-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1211+
yaml.load(yaml_data, Loader=ordereddict.Loader)
12121212
)
12131213
)
12141214
stats = HostlbStatusSummaryTable(self.dev)
@@ -1234,7 +1234,7 @@ def test_table_path_option(self, mock_execute):
12341234
"""
12351235
globals().update(
12361236
FactoryLoader().load(
1237-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1237+
yaml.load(yaml_data, Loader=ordereddict.Loader)
12381238
)
12391239
)
12401240
stats = HostlbStatusSummaryTable(
@@ -1310,7 +1310,7 @@ def test_table_with_item_regex(self, mock_execute):
13101310
"""
13111311
globals().update(
13121312
FactoryLoader().load(
1313-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1313+
yaml.load(yaml_data, Loader=ordereddict.Loader)
13141314
)
13151315
)
13161316
stats = DevicesLocalTable(self.dev)
@@ -1381,7 +1381,7 @@ def test_table_item_group_key_mismatch(self, mock_execute):
13811381
"""
13821382
globals().update(
13831383
FactoryLoader().load(
1384-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1384+
yaml.load(yaml_data, Loader=ordereddict.Loader)
13851385
)
13861386
)
13871387
stats = DevicesLocalTable(self.dev)
@@ -1401,7 +1401,7 @@ def test_table_with_item_without_view(self, mock_execute):
14011401
"""
14021402
globals().update(
14031403
FactoryLoader().load(
1404-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1404+
yaml.load(yaml_data, Loader=ordereddict.Loader)
14051405
)
14061406
)
14071407
stats = EthernetSwitchStatisticsIterTable(self.dev)
@@ -1531,7 +1531,7 @@ def test_title_without_view(self, mock_execute):
15311531
"""
15321532
globals().update(
15331533
FactoryLoader().load(
1534-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1534+
yaml.load(yaml_data, Loader=ordereddict.Loader)
15351535
)
15361536
)
15371537
stats = EthernetSwitchStatistics(self.dev)
@@ -1688,7 +1688,7 @@ def test_valueerror_with_no_target(self, mock_execute):
16881688
"""
16891689
globals().update(
16901690
FactoryLoader().load(
1691-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1691+
yaml.load(yaml_data, Loader=ordereddict.Loader)
16921692
)
16931693
)
16941694
stats = ShowToePfePacketStatsTable(self.dev)
@@ -1756,7 +1756,7 @@ def test_item_with_fields_delimiter(self, mock_execute):
17561756
"""
17571757
globals().update(
17581758
FactoryLoader().load(
1759-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
1759+
yaml.load(yaml_data, Loader=ordereddict.Loader)
17601760
)
17611761
)
17621762
stats = ShowToePfePacketStatsTable(self.dev)
@@ -2093,7 +2093,7 @@ def test_table_eval_expression(self, mock_execute):
20932093
"""
20942094
globals().update(
20952095
FactoryLoader().load(
2096-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
2096+
yaml.load(yaml_data, Loader=ordereddict.Loader)
20972097
)
20982098
)
20992099
stats = XMChipInterruptStatsTable(self.dev)
@@ -2126,7 +2126,7 @@ def test_table_eval_expression_exception(self, mock_execute):
21262126
"""
21272127
globals().update(
21282128
FactoryLoader().load(
2129-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
2129+
yaml.load(yaml_data, Loader=ordereddict.Loader)
21302130
)
21312131
)
21322132
stats = XMChipInterruptStatsTable(self.dev)
@@ -2160,7 +2160,7 @@ def test_table_eval_with_filters(self, mock_execute):
21602160
"""
21612161
globals().update(
21622162
FactoryLoader().load(
2163-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
2163+
yaml.load(yaml_data, Loader=ordereddict.Loader)
21642164
)
21652165
)
21662166
stats = FPCThreads(self.dev)
@@ -2327,7 +2327,7 @@ def test_new_line_in_data(self, mock_execute):
23272327
"""
23282328
globals().update(
23292329
FactoryLoader().load(
2330-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
2330+
yaml.load(yaml_data, Loader=ordereddict.Loader)
23312331
)
23322332
)
23332333
stats = CChipLoStatsTable(self.dev)
@@ -2355,7 +2355,7 @@ def test_textfsm_table(self, mock_execute):
23552355
"""
23562356
globals().update(
23572357
FactoryLoader().load(
2358-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
2358+
yaml.load(yaml_data, Loader=ordereddict.Loader)
23592359
)
23602360
)
23612361
stats = ARPtable(self.dev)
@@ -2386,7 +2386,7 @@ def test_textfsm_table_mutli_key(self, mock_execute):
23862386
"""
23872387
globals().update(
23882388
FactoryLoader().load(
2389-
yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
2389+
yaml.load(yaml_data, Loader=ordereddict.Loader)
23902390
)
23912391
)
23922392
stats = ARPtable(self.dev)

0 commit comments

Comments
 (0)