Merge pull request #29646 from rallytime/fix-29488

Don't stacktrace on kwargs.get if kwargs=None
This commit is contained in:
Mike Place 2015-12-15 12:02:58 -07:00
commit 52cc07cec9

View File

@ -3157,6 +3157,9 @@ def create_snapshot(name, kwargs=None, call=None):
'-a or --action.' '-a or --action.'
) )
if kwargs is None:
kwargs = {}
snapshot_name = kwargs.get('snapshot_name') if kwargs and 'snapshot_name' in kwargs else None snapshot_name = kwargs.get('snapshot_name') if kwargs and 'snapshot_name' in kwargs else None
if not snapshot_name: if not snapshot_name:
@ -3227,6 +3230,9 @@ def revert_to_snapshot(name, kwargs=None, call=None):
'-a or --action.' '-a or --action.'
) )
if kwargs is None:
kwargs = {}
suppress_power_on = _str_to_bool(kwargs.get('power_off', False)) suppress_power_on = _str_to_bool(kwargs.get('power_off', False))
vm_ref = _get_mor_by_property(vim.VirtualMachine, name) vm_ref = _get_mor_by_property(vim.VirtualMachine, name)