COT.commands.edit_properties module

Module for managing VM environment configuration properties.


COTEditProperties Edit OVF environment XML properties.
class COTEditProperties(ui)[source]

Bases: COT.commands.command.ReadWriteCommand

Edit OVF environment XML properties.

Inherited attributes: ui, package, output

Attributes: config_file, properties, transports, user_configurable


Instantiate this command with the given UI.

Parameters:ui (UI) -- User interface instance.

Create 'edit-properties' CLI subparser.


Present an interactive UI for the user to edit properties.


Check whether the module is ready to run().

Returns:tuple -- (True, ready_message) or (False, reason_why_not)

Do the actual work of this command.

Raises:InvalidInputError -- if ready_to_run() reports False

Path to plaintext file to read configuration lines from.

Raises:InvalidInputError -- if the file does not exist.
descriptions = None

List of description strings to set for updated properties.

labels = None

List of label strings to set for the properties being updated.


List of property (key, value, type) tuples to update.

Properties may also be set from strings (such as by CLI) with the syntax <key>[=<value>][+<type>].


>>> from COT.ui import UI
>>> i = COTEditProperties(UI())
>>> = [
... "no_value",
... "key=value",
... "string_type+string",
... "full-type=yes+boolean",
... ]
>>> print("\n".join([str(p) for p in]))
('no_value', None, None)
('key', 'value', None)
('string_type', None, 'string')
('full-type', 'yes', 'boolean')
>>> = [
... "ssh=autopubkey=ssh-rsa AA...q+t0...Tuw== root@MASTER",
... "tricky=+foo",
... "tricky_value=++foo==++",
... "trickiest=bar+foo=hello+boolean",
... ]
>>> print("\n".join([str(p) for p in]))
('ssh', 'autopubkey=ssh-rsa AA...q+t0...Tuw== root@MASTER', None)
('tricky', '', 'foo')
('tricky_value', '++foo==++', None)
('trickiest', 'bar+foo=hello', 'boolean')

Transport mechanism(s) for environment properties.

user_configurable = None

Value to set the user_configurable flag on properties we edit.