[node-patches] Change in ovirt-node[master]: add option to specify org when registering to SAM

mburns at redhat.com mburns at redhat.com
Mon Oct 15 01:31:25 UTC 2012


Michael Burns has uploaded a new change for review.

Change subject: add option to specify org when registering to SAM
......................................................................

add option to specify org when registering to SAM

ONLY SUPPORTED IN auto-install
add rhn_org kernel commandline option
during auto-install, parse and add this option to
subscritption-manager command line in the --org option

rhbz#866274

Change-Id: I7d45a5b3697174fd9e23baa5a8b93c3f948496d4
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M scripts/ovirt-init-functions.sh
M scripts/rhn.py
2 files changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/39/8539/1

diff --git a/scripts/ovirt-init-functions.sh b/scripts/ovirt-init-functions.sh
index 72825aa..b6cf20b 100644
--- a/scripts/ovirt-init-functions.sh
+++ b/scripts/ovirt-init-functions.sh
@@ -210,6 +210,7 @@
     #   rhn_password=RHN-PASSWORD
     #   rhn_profile=RHNPROFILE
     #   rhn_activationkey=ACTIVATIONKEY
+    #   rhn_org=ORG
     # RHN registration, activation key takes precedence
     #   rhn_proxy=PROXY-HOST:PORT
     #   rhn_proxyuser=PROXY-USERNAME
@@ -694,6 +695,9 @@
             rhn_proxypassword=*)
             rhn_proxypassword=${i#rhn_proxypassword=}
             ;;
+            rhn_org=*)
+            rhn_org=${i#rhn_org=}
+            ;;
             ovirt_early=*)
             bootparams="$bootparams $i"
             i=${i#ovirt_early=}
@@ -792,7 +796,7 @@
 
 
     # save boot parameters as defaults for ovirt-config-*
-    params="bootif init init_app vol_boot_size vol_efi_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot rhn_type rhn_url rhn_ca_cert rhn_username rhn_password rhn_profile rhn_activationkey rhn_proxy rhn_proxyuser rhn_proxypassword runtime_mode kdump_nfs iscsi_name snmp_password install netconsole_server netconsole_port stateless cim_enabled wipe_fakeraid iscsi_init iscsi_target_name iscsi_target_host iscsi_target_port iscsi_install"
+    params="bootif init init_app vol_boot_size vol_efi_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot rhn_type rhn_url rhn_ca_cert rhn_username rhn_password rhn_profile rhn_activationkey rhn_org rhn_proxy rhn_proxyuser rhn_proxypassword runtime_mode kdump_nfs iscsi_name snmp_password install netconsole_server netconsole_port stateless cim_enabled wipe_fakeraid iscsi_init iscsi_target_name iscsi_target_host iscsi_target_port iscsi_install"
     # mount /config unless firstboot is forced
     if [ "$firstboot" != "1" ]; then
         mount_config
diff --git a/scripts/rhn.py b/scripts/rhn.py
index 15d4550..c95c271 100755
--- a/scripts/rhn.py
+++ b/scripts/rhn.py
@@ -150,15 +150,17 @@
 
 def run_rhsm(serverurl="", cacert="", activationkey="", username="",
              password="", profilename="", proxyhost="", proxyuser="",
-             proxypass=""):
+             proxypass="", org=""):
     extra_args = ['--force', '--autosubscribe']
     sm = ['/usr/sbin/subscription-manager']
 
     args = list(sm)
     args.append('register')
-    if len(activationkey):
+    if len(activationkey) and len(org):
         args.append('--activationkey')
         args.append(activationkey)
+        args.append('--org')
+        args.append(org)
     elif len(username):
         args.append('--username')
         args.append(username)
@@ -388,6 +390,7 @@
             profilename=OVIRT_VARS["OVIRT_RHN_PROFILE"],
             proxyhost=OVIRT_VARS["OVIRT_RHN_PROXY"],
             proxyuser=OVIRT_VARS["OVIRT_RHN_PROXYUSER"],
+            org=OVIRT_VARS["OVIRT_RHN_ORG"],
             proxypass=OVIRT_VARS["OVIRT_RHN_PROXYPASSWORD"])
     elif OVIRT_VARS["OVIRT_RHN_TYPE"] == "classic":
         reg_rc = run_rhnreg(serverurl=OVIRT_VARS["OVIRT_RHN_URL"],
@@ -583,6 +586,7 @@
                 proxyhost=self.proxyhost.value() + ":" +
                           self.proxyport.value(),
                 proxyuser=self.proxyuser.value(),
+                org="",
                 proxypass=self.proxypass.value())
         else:
             # clear sam registration


--
To view, visit http://gerrit.ovirt.org/8539
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d45a5b3697174fd9e23baa5a8b93c3f948496d4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>



More information about the node-patches mailing list