~smoser/cloud-init/lp-1077700

« back to all changes in this revision

Viewing changes to cloudinit/distros/__init__.py

  • Committer: Scott Moser
  • Date: 2012-11-11 03:24:01 UTC
  • mto: This revision was merged to the branch mainline in revision 712.
  • Revision ID: smoser@ubuntu.com-20121111032401-hson0xw23fov0yon
revert unrelated whitespace changes that creeped in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
        # inputs. If something goes wrong, we can end up with a system
188
188
        # that nobody can login to.
189
189
        adduser_opts = {
190
 
            "gecos": '--comment',
191
 
            "homedir": '--home',
192
 
            "primary_group": '--gid',
193
 
            "groups": '--groups',
194
 
            "passwd": '--password',
195
 
            "shell": '--shell',
196
 
            "expiredate": '--expiredate',
197
 
            "inactive": '--inactive',
198
 
            "selinux_user": '--selinux-user',
199
 
        }
 
190
                "gecos": '--comment',
 
191
                "homedir": '--home',
 
192
                "primary_group": '--gid',
 
193
                "groups": '--groups',
 
194
                "passwd": '--password',
 
195
                "shell": '--shell',
 
196
                "expiredate": '--expiredate',
 
197
                "inactive": '--inactive',
 
198
                "selinux_user": '--selinux-user',
 
199
                }
200
200
 
201
201
        adduser_opts_flags = {
202
 
            "no_user_group": '--no-user-group',
203
 
            "system": '--system',
204
 
            "no_log_init": '--no-log-init',
205
 
            "no_create_home": "-M",
206
 
        }
 
202
                "no_user_group": '--no-user-group',
 
203
                "system": '--system',
 
204
                "no_log_init": '--no-log-init',
 
205
                "no_create_home": "-M",
 
206
                }
207
207
 
208
208
        # Now check the value and create the command
209
209
        for option in kwargs:
320
320
                raise e
321
321
        util.ensure_dir(path, 0750)
322
322
 
323
 
    def write_sudo_rules(self, user, rules, sudo_file=None):
324
 
        if not sudo_file:
325
 
            sudo_file = "/etc/sudoers.d/90-cloud-init-users"
 
323
    def write_sudo_rules(self,
 
324
        user,
 
325
        rules,
 
326
        sudo_file="/etc/sudoers.d/90-cloud-init-users",
 
327
        ):
326
328
 
327
329
        content_header = "# user rules for %s" % user
328
330
        content = "%s\n%s %s\n\n" % (content_header, user, rules)