]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: do not setup_statedir on trigger
authorLoic Dachary <ldachary@redhat.com>
Thu, 1 Jun 2017 09:37:20 +0000 (11:37 +0200)
committerLoic Dachary <ldachary@redhat.com>
Thu, 1 Jun 2017 09:37:20 +0000 (11:37 +0200)
trigger may run when statedir is unavailable and does not use it.

Fixes: http://tracker.ceph.com/issues/19941
Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py

index 0487ee2e6d0e8798520d02b4b2c43e605122691a..c4ff1313b0639c5c4b29044ee4e99802772b6c04 100755 (executable)
@@ -5601,7 +5601,9 @@ def main(argv):
         path = os.environ.get('PATH', os.defpath)
         os.environ['PATH'] = args.prepend_to_path + ":" + path
 
-    setup_statedir(args.statedir)
+    if args.func.__name__ != 'main_trigger':
+        # trigger may run when statedir is unavailable and does not use it
+        setup_statedir(args.statedir)
     setup_sysconfdir(args.sysconfdir)
 
     global CEPH_PREF_USER