Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: fix NULL user passwords on import
......................................................................

packaging: setup: fix NULL user passwords on import

extension to Ibc7202233, not sure how it worked so far.

probably applies to 3.3 as well.

Change-Id: Ie9020967683f0ff328890abdc83094fa6a5ea5e2
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M packaging/legacy-setup/common_utils.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/01/23401/1

diff --git a/packaging/legacy-setup/common_utils.py 
b/packaging/legacy-setup/common_utils.py
index 85b8214..05c813a 100755
--- a/packaging/legacy-setup/common_utils.py
+++ b/packaging/legacy-setup/common_utils.py
@@ -661,10 +661,10 @@
     execExternalCmd(cmd, True, "Failed while importing reports")
     os.chdir(current_dir)
 
-def fixNullUserPasswords(tempDir):
+def fixNullUserPasswords(tempDir, loc):
     logging.debug("fixNullUserPasswords started for %s" % tempDir)
     fixedFiles = []
-    for f in glob.glob(tempDir + '/users/organization_1/*.xml'):
+    for f in glob.glob(os.path.join(tempDir, loc, '*.xml')):
         xmlObj = XMLConfigFileHandler(f)
         xmlObj.open()
         node = getXmlNode(xmlObj, '/user/password')
@@ -692,7 +692,7 @@
     logging.debug("Exporting users to %s" % tempDir)
     cmd = "./js-export.sh --output-dir %s --users --roles" % tempDir
     execExternalCmd(cmd, True, "Failed while exporting users")
-    fixNullUserPasswords(tempDir)
+    fixNullUserPasswords(tempDir, 'users/organization_1')
 
     os.chdir(current_dir)
     return tempDir
@@ -714,6 +714,7 @@
     logging.debug("Exporting repository to %s" % tempDir)
     cmd = "./js-export.sh --output-dir %s --everything" % tempDir
     execExternalCmd(cmd, True, "Failed while exporting users")
+    fixNullUserPasswords(tempDir, 'users')
 
     os.chdir(current_dir)
     return tempDir


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9020967683f0ff328890abdc83094fa6a5ea5e2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-reports
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to