Merge "honor zvm_default_admin_userid"

This commit is contained in:
Jenkins 2017-04-28 08:36:29 +00:00 committed by Gerrit Code Review
commit 905f047cbd
1 changed files with 8 additions and 1 deletions

View File

@ -276,11 +276,18 @@ class ZVMInstance(object):
def _create_user_id_body(self, boot_from_volume):
kwprofile = 'profile=%s' % CONF.zvm_user_profile
body = [kwprofile,
'password=%s' % CONF.zvm_user_default_password,
'cpu=%i' % self._instance['vcpus'],
'memory=%im' % self._instance['memory_mb'],
'privilege=%s' % CONF.zvm_user_default_privilege]
# if we don't set admin userid, then we will used old password
# field, otherwise, will use logon by method.
if not CONF.zvm_default_admin_userid:
body.append('password=%s' % CONF.zvm_user_default_password)
else:
body.append('password=LBYONLY')
body.append('logonby=%s' % CONF.zvm_default_admin_userid)
# if mkvm in lower version xcat won't support it
# they will ignore this param.
if not boot_from_volume: