~jamesbeedy/charm-helpers/add_uid_gid

« back to all changes in this revision

Viewing changes to charmhelpers/core/host.py

  • Committer: James Beedy
  • Date: 2016-05-31 20:23:32 UTC
  • mfrom: (580.1.1 add_uid_gid)
  • Revision ID: jbeedy@virt-test0-20160531202332-le6agzrnvcpkos7h
Merge  lp:~mbruzek/charm-helpers/add_uid_gid

Fix text conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
    """Return True if the host system uses systemd, False otherwise."""
175
175
    return os.path.isdir(SYSTEMD_SYSTEM)
176
176
 
177
 
 
178
 
def adduser(username, uid=None, password=None, shell='/bin/bash',
179
 
            system_user=False, primary_group=None, secondary_groups=None):
 
177
def adduser(username, password=None, shell='/bin/bash', system_user=False,
 
178
            primary_group=None, secondary_groups=None, uid=None):
180
179
    """Add a user to the system.
181
180
 
182
181
    Will log but otherwise succeed if the user already exists.
183
182
 
184
183
    :param str username: Username to create
185
 
    :param int uid: UID for user being created
186
184
    :param str password: Password for user; if ``None``, create a system user
187
185
    :param str shell: The default shell for the user
188
186
    :param bool system_user: Whether to create a login or system user
189
187
    :param str primary_group: Primary group for user; defaults to username
190
188
    :param list secondary_groups: Optional list of additional groups
 
189
    :param int uid: UID for user being created
191
190
 
192
191
    :returns: The password database entry struct, as returned by `pwd.getpwnam`
193
192
    """