From 1783d2dce586d6539348a9dde341f13ea46b0cf3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Mon, 30 Sep 2019 13:31:47 +0200
Subject: [PATCH] misc: use relative imports to get publisher in ctl command
 (#36518)

---
 wcs/ctl/backup.py          | 2 +-
 wcs/ctl/check_hobos.py     | 4 ++--
 wcs/ctl/delete_tenant.py   | 2 +-
 wcs/ctl/export_settings.py | 2 +-
 wcs/ctl/hobo_notify.py     | 2 +-
 wcs/ctl/rebuild_indexes.py | 2 +-
 wcs/ctl/restore.py         | 2 +-
 wcs/ctl/runscript.py       | 2 +-
 wcs/ctl/shell.py           | 2 +-
 wcs/ctl/wipe_data.py       | 2 +-
 10 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/wcs/ctl/backup.py b/wcs/ctl/backup.py
index 694987af7..e08e73aa8 100644
--- a/wcs/ctl/backup.py
+++ b/wcs/ctl/backup.py
@@ -31,7 +31,7 @@ class CmdBackup(Command):
                 ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
 
         publisher.WcsPublisher.configure(self.config)
         pub = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/check_hobos.py b/wcs/ctl/check_hobos.py
index 32afd9951..71db6f52b 100644
--- a/wcs/ctl/check_hobos.py
+++ b/wcs/ctl/check_hobos.py
@@ -60,7 +60,7 @@ class CmdCheckHobos(Command):
                 ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
         publisher.WcsPublisher.configure(self.config)
         if sub_options.redeploy:
             sub_options.ignore_timestamp = True
@@ -81,7 +81,7 @@ class CmdCheckHobos(Command):
             self.deploy(base_options, sub_options, args)
 
     def deploy(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
 
         self.base_options = base_options
         if sub_options.extra:
diff --git a/wcs/ctl/delete_tenant.py b/wcs/ctl/delete_tenant.py
index 20d6ad62a..e06335e24 100644
--- a/wcs/ctl/delete_tenant.py
+++ b/wcs/ctl/delete_tenant.py
@@ -34,7 +34,7 @@ class CmdDeleteTenant(Command):
                 ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
 
         publisher.WcsPublisher.configure(self.config)
         pub = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/export_settings.py b/wcs/ctl/export_settings.py
index 4f1a50fdd..a6aed1582 100644
--- a/wcs/ctl/export_settings.py
+++ b/wcs/ctl/export_settings.py
@@ -28,7 +28,7 @@ class CmdExportSettings(Command):
                 ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
         self.config.remove_option('main', 'error_log')
         publisher.WcsPublisher.configure(self.config)
         pub = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/hobo_notify.py b/wcs/ctl/hobo_notify.py
index 6a3f1b61a..fbe303592 100644
--- a/wcs/ctl/hobo_notify.py
+++ b/wcs/ctl/hobo_notify.py
@@ -40,7 +40,7 @@ class CmdHoboNotify(Command):
         notification = self.load_notification(args)
         if not self.check_valid_notification(notification):
             sys.exit(1)
-        import publisher
+        from .. import publisher
 
         publisher.WcsPublisher.configure(self.config)
         pub = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/rebuild_indexes.py b/wcs/ctl/rebuild_indexes.py
index 5e5ee493d..4cdf64e9f 100644
--- a/wcs/ctl/rebuild_indexes.py
+++ b/wcs/ctl/rebuild_indexes.py
@@ -52,7 +52,7 @@ class CmdRebuildIndexes(Command):
                 ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
 
         publisher.WcsPublisher.configure(self.config)
         pub = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/restore.py b/wcs/ctl/restore.py
index 163657178..cfe3545cc 100644
--- a/wcs/ctl/restore.py
+++ b/wcs/ctl/restore.py
@@ -31,7 +31,7 @@ class CmdRestore(Command):
                 ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
 
         self.config.remove_option('main', 'error_log')
         publisher.WcsPublisher.configure(self.config)
diff --git a/wcs/ctl/runscript.py b/wcs/ctl/runscript.py
index 4fd04bf75..6a3183fc1 100644
--- a/wcs/ctl/runscript.py
+++ b/wcs/ctl/runscript.py
@@ -34,7 +34,7 @@ class CmdRunScript(Command):
 
     def execute(self, base_options, sub_options, args):
         warnings.warn('Deprecated command, use management command', DeprecationWarning)
-        import publisher
+        from .. import publisher
         self.config.remove_option('main', 'error_log')
         publisher.WcsPublisher.configure(self.config)
         publisher = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/shell.py b/wcs/ctl/shell.py
index a8520b3dd..e69a7a385 100644
--- a/wcs/ctl/shell.py
+++ b/wcs/ctl/shell.py
@@ -33,7 +33,7 @@ class CmdShell(Command):
                             dest='plain', default=False) ])
 
     def execute(self, base_options, sub_options, args):
-        import publisher
+        from .. import publisher
         self.config.remove_option('main', 'error_log')
         publisher.WcsPublisher.configure(self.config)
         publisher = publisher.WcsPublisher.create_publisher(
diff --git a/wcs/ctl/wipe_data.py b/wcs/ctl/wipe_data.py
index 341f28923..441cfd5e2 100644
--- a/wcs/ctl/wipe_data.py
+++ b/wcs/ctl/wipe_data.py
@@ -35,7 +35,7 @@ class CmdWipeData(Command):
             print >> sys.stderr, 'you must specify --vhost'
             sys.exit(1)
 
-        import publisher
+        from .. import publisher
         publisher.WcsPublisher.configure(self.config)
         pub = publisher.WcsPublisher.create_publisher(
                 register_tld_names=False)
-- 
2.23.0

