-- 
Dimitar Yordanov
Systems Management QA
#satellite-qa
From d4290838141676727db093499230e5b642c25c80 Mon Sep 17 00:00:00 2001
From: Dimitar Yordanov <dyord...@redhat.com>
Date: Wed, 5 Feb 2014 15:48:56 +0100
Subject: [PATCH] 870990 - sw-rm-ch -l when satellite-sync runs.

---
 backend/satellite_tools/spacewalk-remove-channel | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/backend/satellite_tools/spacewalk-remove-channel b/backend/satellite_tools/spacewalk-remove-channel
index 3ca931d..5b5380f 100755
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -65,16 +65,6 @@ def main():
         sys.stderr.write('ERROR: must be root to execute\n')
         sys.exit(8)
 
-    for command in ['spacewalk-remove-channel', 'satellite-sync',
-                    'spacewalk-repo-sync']:
-        try:
-            LOCK.append(rhnLockfile.Lockfile(
-                                os.path.join(LOCK_DIR, "%s.pid" % command)))
-        except rhnLockfile.LockfileLockedException:
-            print("ERROR: An instance of %s is running, exiting." % command)
-            sys.exit(-1)
-
-
     global options_table
     parser = OptionParser(option_list=options_table)
 
@@ -89,6 +79,16 @@ def main():
         sys.stderr.write("Nothing to do\n")
         sys.exit(0)
 
+    if  not options.list:
+        for command in ['spacewalk-remove-channel', 'satellite-sync',
+                    'spacewalk-repo-sync']:
+            try:
+                LOCK.append(rhnLockfile.Lockfile(
+                                os.path.join(LOCK_DIR, "%s.pid" % command)))
+            except rhnLockfile.LockfileLockedException:
+                print("ERROR: An instance of %s is running, exiting." % command)
+                sys.exit(-1)
+
     initCFG('server')
     initLOG("stdout", options.verbose or 0)
 
-- 
1.8.3.1

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to