cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #01519
Re: [Merge] ~msaikia/cloud-init:topic-msaikia-vmware into cloud-init:master
Diff comments:
> diff --git a/cloudinit/sources/helpers/vmware/imc/config.py b/cloudinit/sources/helpers/vmware/imc/config.py
> index d645c49..711dc0b 100644
> --- a/cloudinit/sources/helpers/vmware/imc/config.py
> +++ b/cloudinit/sources/helpers/vmware/imc/config.py
> @@ -28,11 +30,15 @@ class Config(object):
>
> DNS = 'DNS|NAMESERVER|'
> SUFFIX = 'DNS|SUFFIX|'
> - PASS = 'PASSWORD|-PASS'
> TIMEZONE = 'DATETIME|TIMEZONE'
> UTC = 'DATETIME|UTC'
> HOSTNAME = 'NETWORK|HOSTNAME'
> DOMAINNAME = 'NETWORK|DOMAINNAME'
> + CUSTOM_SCRIPT = 'CUSTOM-SCRIPT|SCRIPT-NAME'
> + PASS = 'PASSWORD|-PASS'
> + RESETPASS = 'PASSWORD|RESET'
> + MARKERID = 'MISC|MARKER-ID'
> + POST_GC = 'MISC|POST-GC-STATUS'
Thanks. I just wanted to keep functions related to a certain product together. But sorted sounds good too.
>
> def __init__(self, configFile):
> self._configFile = configFile
> @@ -93,3 +94,34 @@ class Config(object):
> res.append(Nic(nic, self._configFile))
>
> return res
> +
> + @property
> + def admin_password(self):
> + """Return the root password to be set."""
> + return self._configFile.get(Config.PASS, None)
The reason i moved this was just to keep all the methods associated to a particular product together. But it is nothing critical. So I can move it back to where it was.
> +
> + @property
> + def reset_password(self):
> + """Retreives if the root password needs to be reset."""
> + resetPass = self._configFile.get(Config.RESETPASS, None)
> + if resetPass and not re.match('yes$|no$', resetPass.lower()):
> + raise ValueError('ResetPassword value should be yes/no')
> + return resetPass
> +
> + @property
> + def marker_id(self):
> + """Returns marker id."""
> + return self._configFile.get(Config.MARKERID, None)
> +
> + @property
> + def post_gc_status(self):
> + """Retreives if customization status needs to be posted."""
> + postGcStatus = self._configFile.get(Config.POST_GC, None)
> + if postGcStatus and not re.match('yes$|no$', postGcStatus.lower()):
> + raise ValueError('GC status value should be yes/no')
> + return postGcStatus
> +
> + @property
> + def custom_script_name(self):
> + """Return the name of custom (pre/post) script."""
> + return self._configFile.get(Config.CUSTOM_SCRIPT, None)
--
https://code.launchpad.net/~msaikia/cloud-init/+git/cloud-init/+merge/305427
Your team cloud init development team is requested to review the proposed merge of ~msaikia/cloud-init:topic-msaikia-vmware into cloud-init:master.
References