Skip to content

Commit

Permalink
"version 1.1.6"
Browse files Browse the repository at this point in the history
  • Loading branch information
vhowdhur committed May 24, 2022
1 parent 974520e commit 74b24ab
Show file tree
Hide file tree
Showing 215 changed files with 3,317 additions and 13,104 deletions.
10 changes: 10 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Release Notes
### May 2022
* 1.1.6
* support ixnetwork version 9.20.2201.69 (9.20 Update-1)
* support uhd version 1.5
* fixed issue #65: quicktest testconfig configuration not updating parameters
* fixed issue #66: Read content of Multivalue
* exposed new property PatternType in Multivalue class
* samples - patternType_in_multivalue
* catagorical representation of samples in restpy documentation
* link: https://openixia.github.io/ixnetwork_restpy/#/samples
### Apr 2022
* 1.1.5
* support ixnetwork version 9.20.2199.45 (9.20 patch-1)
Expand Down
4 changes: 4 additions & 0 deletions ixnetwork_restpy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,10 @@ def _get_ngpf_device_ids(self, locals_dict=dict()):

def _map_locals(self, sdm_att_map, locals_dict):
mapped_dict = {}

# Should also handle functions with kwargs
locals_dict = locals_dict["kwargs"] if "kwargs" in locals_dict else locals_dict

for key in locals_dict.keys():
if key in sdm_att_map.keys():
mapped_dict[sdm_att_map[key]] = locals_dict[key]
Expand Down
31 changes: 31 additions & 0 deletions ixnetwork_restpy/multivalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, parent, href):
super(Multivalue, self).__init__(parent)
self._href = href
self._pattern = None
self._pattern_type = ""
self._dirty = False
self.parent_href = ""
self._multiValueObj = {"multiValue": []}
Expand Down Expand Up @@ -79,17 +80,21 @@ def Pattern(self):
self._custom_select()
if self._properties["pattern"] == "singleValue":
self._pattern = self._format_value(self._properties["singleValue"]["value"])
self._pattern_type = "Single"
elif self._properties["pattern"] == "counter":
start = self._format_value(self._properties["counter"]["start"])
step = self._format_value(self._properties["counter"]["step"])
if self._properties["counter"]["direction"] == "decrement":
self._pattern = "Dec: %s, %s" % (start, step)
self._pattern_type = "Decrement"
else:
self._pattern = "Inc: %s, %s" % (start, step)
self._pattern_type = "Increment"
elif self._properties["pattern"] == "valueList":
self._pattern = "List: %s" % (
", ".join(self._properties["valueList"]["values"])
)
self._pattern_type = "ValueList"
elif self._properties["pattern"] == "repeatableRandomRange":
min_value = self._properties["repeatableRandomRange"]["min"]
max_value = self._properties["repeatableRandomRange"]["max"]
Expand All @@ -101,6 +106,7 @@ def Pattern(self):
step_value,
seed,
)
self._pattern_type = "RandomRange"
elif self._properties["pattern"] == "repeatableRandom":
fixed_value = self._properties["repeatableRandom"]["fixed"]
mask_value = self._properties["repeatableRandom"]["mask"]
Expand All @@ -112,12 +118,15 @@ def Pattern(self):
seed,
count,
)
self._pattern_type = "RandomMask"
elif self._properties["pattern"] == "random":
self._pattern = "Rand"
self._pattern_type = "Random"
elif self._properties["pattern"] == "alternate":
self._pattern = "Alt: %s" % self._format_value(
self._properties["alternate"]["value"]
)
self._pattern_type = "Alternate"
elif self._properties["pattern"] == "customDistributed":
values = []
for value_pair in self._properties["customDistributed"]["values"]:
Expand All @@ -128,6 +137,7 @@ def Pattern(self):
algorithm = self._properties["customDistributed"]["algorithm"]
mode = self._properties["customDistributed"]["mode"]
self._pattern = "Dist: %s, %s, [%s]" % (algorithm, mode, ",".join(values))
self._pattern_type = "Distributed"
elif self._properties["pattern"] == "custom":
increments = []
if "increment" in self._properties["custom"].keys():
Expand All @@ -137,8 +147,16 @@ def Pattern(self):
start = self._properties["custom"]["start"]
step = self._properties["custom"]["step"]
self._pattern = "Custom: %s, %s, [%s]" % (start, step, ",".join(increments))
self._pattern_type = "Custom"
elif self._properties["pattern"] == "string":
self._pattern = self._properties["string"]["pattern"]
self._pattern_type = "String"

if self._pattern_type == "":
raise Exception(
"Could not retrieve Pattern type for the multivalue Instance"
)

return self._pattern

def _add_increments(self, increments, increment):
Expand All @@ -160,6 +178,19 @@ def __repr__(self):
def __eq__(self, other):
return self.Pattern == other

@property
def PatternType(self):
# type: () -> str
"""
Returns
-------
- str: a string containing information about the type for this Multivalue.
possible return values (Alternate, Custom, Decrement, Distributed, Increment, Random, RandomRange,
RandomMask, Single, String, ValueList)
"""
self.Pattern
return self._pattern_type

@property
def Info(self):
"""
Expand Down
2 changes: 0 additions & 2 deletions ixnetwork_restpy/pytest_tests/.pytest_cache/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions ixnetwork_restpy/pytest_tests/.pytest_cache/CACHEDIR.TAG

This file was deleted.

8 changes: 0 additions & 8 deletions ixnetwork_restpy/pytest_tests/.pytest_cache/README.md

This file was deleted.

Loading

0 comments on commit 74b24ab

Please sign in to comment.