~smoser/ubuntu/quantal/cloud-init/sru

« back to all changes in this revision

Viewing changes to cloudinit/config/cc_set_passwords.py

  • Committer: Scott Moser
  • Date: 2012-09-02 00:04:35 UTC
  • mto: This revision was merged to the branch mainline in revision 209.
  • Revision ID: smoser@ubuntu.com-20120902000435-vql7mh69x2ftrejr
Tags: upstream-0.7.0~bzr644
ImportĀ upstreamĀ versionĀ 0.7.0~bzr644

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
        user = cloud.distro.get_default_user()
54
54
 
55
55
        if 'users' in cfg:
56
 
            user_zero = cfg['users'].keys()[0]
57
 
 
58
 
            if user_zero != "default":
59
 
                user = user_zero
 
56
 
 
57
            user_zero = cfg['users'][0]
 
58
 
 
59
            if isinstance(user_zero, dict) and 'name' in user_zero:
 
60
                user = user_zero['name']
60
61
 
61
62
        if user:
62
63
            plist = "%s:%s" % (user, password)
63
64
 
 
65
        else:
 
66
            log.warn("No default or defined user to change password for.")
 
67
 
64
68
    errors = []
65
69
    if plist:
66
70
        plist_in = []