misc: use relative imports to get publisher in ctl command (#36517)

This commit is contained in:
Frédéric Péters 2019-09-30 13:31:47 +02:00
parent 1b1e596d1f
commit 8b9c2f838e
10 changed files with 11 additions and 11 deletions

View File

@ -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(

View File

@ -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:

View File

@ -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(

View File

@ -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(

View File

@ -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(

View File

@ -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(

View File

@ -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)

View File

@ -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(

View File

@ -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(

View File

@ -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)