Skip to content

Commit aa81a24

Browse files
authored
Merge pull request #28 from thgrw/tags-translation
Tags translation
2 parents 2237349 + 7e2cec0 commit aa81a24

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 3.0.5
4+
5+
- Bug fix: Tags fields need additional translation when modifying
6+
7+
## 3.0.4
8+
9+
- Bug fix: PATCH requests don't need all the fields to be required
10+
311
## 3.0.3
412

513
- Updated spec as per v3.1.7

actions/lib/action.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def make_request(self, endpoint_uri, http_action, **kwargs):
3838

3939
# transform `tags` if present
4040
if kwargs.get("tags"):
41-
kwargs["tags"] = ",".join(kwargs["tags"])
41+
if http_action in ['post', 'put', 'patch']:
42+
kwargs["tags"] = [{"slug": x} for x in kwargs["tags"]]
43+
else:
44+
kwargs["tags"] = ",".join(kwargs["tags"])
4245
self.logger.debug("tags transformed to {}".format(kwargs["tags"]))
4346

4447
# strip values which have a None value if we are making a write request

bin/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def run(spec):
108108
ref_name = verb_data['parameters'][0]['schema']['$ref'].split('/')[-1]
109109
schema = spec['definitions'][ref_name]
110110
try:
111-
required = schema['required']
111+
required = ['id'] if verb == 'patch' else schema['required']
112112
except KeyError:
113113
required = []
114114
action['parameters'] = parse_properties(schema['properties'], required, spec)

pack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords:
66
- networking
77
- ipam
88
- dcim
9-
version: 3.0.3
9+
version: 3.0.5
1010
author: John Anderson, Jefferson White
1111
1212
python_versions:

0 commit comments

Comments
 (0)