← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~msaikia/cloud-init:topic-msaikia-vmware into cloud-init:master

 

Please set a combined commit message ('Set commit message' above.

Can you explain where you're going also?
I'm concerned about adding more "vmware" paths for configuring things that are done elsewhere (or not elsewhere) in cloud-init.  We'd like have consistent paths for doing things as much as possible.

I understand that you're trying to have cloud-init take over another more solution, and I'm not entirely opposed to that, but I want to integrate as much as possible rather than having specific paths and function on vmware.


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'

If you're going to move these around, you might as well sort the whole thing.  Then there is a clear order for future changes.

>  
>      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)

this change (moving 'admin_password' down. just seems like noise unless you have an explanation.

> +
> +    @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.


Follow ups

References