check_hobos: add --redeploy option (#8894)
This commit is contained in:
parent
cdd412648b
commit
0257dee49f
|
@ -42,9 +42,29 @@ class CmdCheckHobos(Command):
|
|||
Command.__init__(self, [
|
||||
make_option('--ignore-timestamp', action='store_true',
|
||||
dest='ignore_timestamp', default=False),
|
||||
make_option('--redeploy', action='store_true', default=False),
|
||||
])
|
||||
|
||||
def execute(self, base_options, sub_options, args):
|
||||
if sub_options.redeploy:
|
||||
sub_options.ignore_timestamp = True
|
||||
for tenant in os.listdir(WcsPublisher.APP_DIR):
|
||||
if tenant.endswith('.invalid'):
|
||||
continue
|
||||
hobo_json_path = os.path.join(tenant, 'hobo.json')
|
||||
if not os.path.exists(hobo_json_path):
|
||||
continue
|
||||
hobo_json = json.load(open(hobo_json_path))
|
||||
try:
|
||||
me = [service for service in hobo_json['services'] if service['this'] is True][0]
|
||||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
self.deploy(base_options, sub_options, [me['base_url'], hobo_json_path])
|
||||
else:
|
||||
self.deploy(base_options, sub_options, args)
|
||||
|
||||
def deploy(self, base_options, sub_options, args):
|
||||
import publisher
|
||||
|
||||
self.base_options = base_options
|
||||
|
|
Loading…
Reference in New Issue