schema_args: Do not generate option for read-only properties
The schema_args decorator generates command line options based on the properties defined in a schema. This commit makes sure read-only properties are skipped during this process, since trying to modify their value would result in a Glance error. Closes-Bug: #1561828 Change-Id: I7ccc628a23c9ebdaeedcb9e6d43559f497ce9555
This commit is contained in:
@@ -123,6 +123,8 @@ def schema_args(schema_getter, omit=None):
|
||||
for name, property in properties.items():
|
||||
if name in omit:
|
||||
continue
|
||||
if property.get('readOnly', False):
|
||||
continue
|
||||
param = '--' + name.replace('_', '-')
|
||||
kwargs = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user