misc: use relative imports to get publisher in ctl command (#36517)
This commit is contained in:
parent
1b1e596d1f
commit
8b9c2f838e
|
@ -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(
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue