launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15173
[Merge] lp:~andreserl/maas/ipmi_usercreation_ilo_versions_trunk into lp:maas
Andres Rodriguez has proposed merging lp:~andreserl/maas/ipmi_usercreation_ilo_versions_trunk into lp:maas.
Commit message:
Refactor IPMI user creation to support iLO3 (it is backwards compatible to older versions)
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~andreserl/maas/ipmi_usercreation_ilo_versions_trunk/+merge/148579
--
https://code.launchpad.net/~andreserl/maas/ipmi_usercreation_ilo_versions_trunk/+merge/148579
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~andreserl/maas/ipmi_usercreation_ilo_versions_trunk into lp:maas.
=== modified file 'contrib/preseeds_v2/enlist_userdata'
--- contrib/preseeds_v2/enlist_userdata 2012-11-30 17:35:04 +0000
+++ contrib/preseeds_v2/enlist_userdata 2013-02-14 23:59:43 +0000
@@ -99,9 +99,20 @@
res = show_re.search(output)
return res.group()
+ def get_ipmi_user_number(user):
+ for i in range(1, 17):
+ ipmi_user_number = "User%s" % i
+ (status, output) = commands.getstatusoutput('bmc-config --checkout --key-pair="%s:Username"' % ipmi_user_number)
+ if user in output:
+ return ipmi_user_number
+ return None
+
def commit_ipmi_user_settings(user, password):
- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User3:Username=%s"' % user)
- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User3:Password=%s"' % password)
+ ipmi_user_number = get_ipmi_user_number(user)
+ if ipmi_user_number is None:
+ (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User10:Username=%s"' % user)
+ ipmi_user_number = get_ipmi_user_number(user)
+ (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="%s:Password=%s"' % (ipmi_user_number, password))
def commit_ipmi_settings(config):
(status, output) = commands.getstatusoutput('bmc-config --commit --filename %s' % config)
@@ -147,10 +158,7 @@
time.sleep(120)
# create user/pass
- if args.commission_creds:
- IPMI_MAAS_USER="maas-commission"
- else:
- IPMI_MAAS_USER="maas"
+ IPMI_MAAS_USER="maas"
IPMI_MAAS_PASSWORD=generate_random_password()
# Configure IPMI user/password
=== modified file 'src/metadataserver/commissioning/user_data.template'
--- src/metadataserver/commissioning/user_data.template 2013-02-06 13:59:35 +0000
+++ src/metadataserver/commissioning/user_data.template 2013-02-14 23:59:43 +0000
@@ -265,9 +265,20 @@
res = show_re.search(output)
return res.group()
+def get_ipmi_user_number(user):
+ for i in range(1, 17):
+ ipmi_user_number = "User%s" % i
+ (status, output) = commands.getstatusoutput('bmc-config --checkout --key-pair="%s:Username"' % ipmi_user_number)
+ if user in output:
+ return ipmi_user_number
+ return None
+
def commit_ipmi_user_settings(user, password):
- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User3:Username=%s"' % user)
- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User3:Password=%s"' % password)
+ ipmi_user_number = get_ipmi_user_number(user)
+ if ipmi_user_number is None:
+ (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User10:Username=%s"' % user)
+ ipmi_user_number = get_ipmi_user_number(user)
+ (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="%s:Password=%s"' % (ipmi_user_number, password))
def commit_ipmi_settings(config):
(status, output) = commands.getstatusoutput('bmc-config --commit --filename %s' % config)
Follow ups