[node-patches] Change in ovirt-node[master]: fix list assignment in rhn code

mburns at redhat.com mburns at redhat.com
Mon Oct 15 00:57:45 UTC 2012


Michael Burns has uploaded a new change for review.

Change subject: fix list assignment in rhn code
......................................................................

fix list assignment in rhn code

in python, when variable "a" is a list, and you assign

b=a

you get 2 variables pointing to the same list.  So any
operation you do on a, get done on b and vice versa.
Instead of this, do b=list(a) to get a new list with the
same content.

Change-Id: I3ac8365d605dd664b74243bd76889b1c9e41e608
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M scripts/rhn.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/38/8538/1

diff --git a/scripts/rhn.py b/scripts/rhn.py
index 1022efe..49cb471 100755
--- a/scripts/rhn.py
+++ b/scripts/rhn.py
@@ -100,7 +100,7 @@
     if os.path.exists("/etc/sysconfig/rhn/up2date"):
         os.unlink("/etc/sysconfig/rhn/up2date")
 
-    logged_args = args
+    logged_args = list(args)
     remove_values_from_args = ["--password", "--proxyPassword"]
     for idx, arg in enumerate(logged_args):
         if arg in remove_values_from_args:
@@ -250,7 +250,7 @@
     for f in all_rhsm_configs:
         unlink_if_exists(f)
 
-    logged_args = args
+    logged_args = list(args)
     remove_values_from_args = ["--password", "--proxypassword"]
     for idx, arg in enumerate(logged_args):
         if arg in remove_values_from_args:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ac8365d605dd664b74243bd76889b1c9e41e608
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