[omd-commits] OMD Git: omd: Hopefully fix omd mv

git version control git at mathias-kettner.de
Mon Dec 20 19:54:51 CET 2010


Module: omd
Branch: master
Commit: a58fc7c78a808a73f437f1aaf146081cdf53815a
URL:    http://omdistro.org/projects/omd/repository/revisions/a58fc7c78a808a73f437f1aaf146081cdf53815a

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Mon Dec 20 19:53:39 2010 +0100

Hopefully fix omd mv

---

 packages/{check_mk => mk-livestatus}/lq |    0 
 packages/omd/omd                        |   10 ++++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/packages/check_mk/lq b/packages/mk-livestatus/lq
similarity index 100%
rename from packages/check_mk/lq
rename to packages/mk-livestatus/lq
diff --git a/packages/omd/omd b/packages/omd/omd
index c37a003..22436fb 100644
--- a/packages/omd/omd
+++ b/packages/omd/omd
@@ -1725,15 +1725,17 @@ def main_mv_or_cp(what, args, options={}):
     sys.stdout.write("%sing site %s to %s..." % (what == "mv" and "Mov" or "Copy", old, new))
     sys.stdout.flush()
 
+    # Create new user. Note: even on mv we need to create a new user.
+    # Linux does not (officially) allow to rename a user.
+    uid = options.get("uid")
+    gid = options.get("gid")
+    useradd(new, uid, gid)
+
     if what == "mv":
         # Rename base directory and apache config
         os.rename(site_dir(old), site_dir(new))
         delete_apache_hook(old)
     else:
-        uid = options.get("uid")
-        gid = options.get("gid")
-        useradd(new, uid, gid)
-
         # Make exact file-per-file copy with same user but already new name
         os.mkdir(site_dir(new))
         os.system("rsync -arx '%s/' '%s/'" % (site_dir(g_sitename), site_dir(new)))



More information about the omd-commits mailing list