5 Commits

Author SHA1 Message Date
John L. Villalovos
67fac2f0aa Replace use of functools.wraps() with six.wraps()
In Python 2.7, functools.wraps() does not provide the '__wrapped__'
attribute. This attribute is used by
oslo_utils.reflection.get_signature() when getting the signature of a
function. If a function is decorated without the '__wrapped__'
attribute then the signature will be of the decorator rather than the
underlying function.

From the six documentation for six.wraps():
    This is exactly the functools.wraps() decorator, but it sets the
    __wrapped__ attribute on what it decorates as functools.wraps()
    does on Python versions after 3.2.

Change-Id: I6be901f8e01e0ff1b1e2b8c5197b320b5f8026fb
2018-02-01 16:31:15 -08:00
Jenkins
f1f10cbfe5 Merge "Allow creating portgroups via create commands" 2017-01-25 20:38:02 +00:00
Vladyslav Drok
d9f595bd82 Allow creating portgroups via create commands
This change allows specifying portgroups (that themselves may contain
ports) inside the nodes dictionaries.

Related-Bug: #1618754
Change-Id: I858412d135717e78291bbef8b0861ef00c5d4fdb
2017-01-25 18:53:27 +02:00
Luong Anh Tuan
c3f1cb56a1 Replace yaml.load() with yaml.safe_load()
Avoid dangerous file parsing and object serialization libraries.
yaml.load is the obvious function to use but it is dangerous[1]
Bandit flags yaml.load() as security risk so replace all occurrences
with yaml.safe_load().

[1]https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html

Change-Id: I6db250c03b8a9ca1942e1809831190b0e10423a5
Closes-Bug: #1634265
2017-01-16 14:36:20 +07:00
Vladyslav Drok
91c4539bf3 Add create command to ironic client
This patch adds "ironic create" and "openstack create" commands
understanding JSON and YAML files, documentation for it will be
added in a subsequent patch.

Partial-bug: #1588339
Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
Change-Id: I9b6a6d41fabd240ace65e7ac8b965af81c1b3272
2016-08-08 19:41:36 +03:00