agent: only read stdin if - is passed as filename
This makes it easier to use pdb to interactively debug the deployment code.
This commit is contained in:
parent
ed2b9a88f0
commit
7f07faee2a
|
@ -22,8 +22,11 @@ def replace_file(path, content):
|
|||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def handle(self, base_url, *args, **kwargs):
|
||||
hobo_environment = json.load(sys.stdin)
|
||||
def handle(self, base_url, json_filename, *args, **kwargs):
|
||||
if json_filename == '-':
|
||||
hobo_environment = json.load(sys.stdin)
|
||||
else:
|
||||
hobo_environment = json.load(file(json_filename))
|
||||
me = [x for x in hobo_environment.get('services') if x.get('base_url') == base_url][0]
|
||||
domain = urlparse.urlparse(me.get('base_url')).netloc.split(':')[0]
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class BaseService(object):
|
|||
return False
|
||||
|
||||
def execute(self, environment):
|
||||
cmd_process = subprocess.Popen(self.service_manage_cmd + ' hobo_deploy ' + self.base_url,
|
||||
cmd_process = subprocess.Popen(self.service_manage_cmd + ' hobo_deploy ' + self.base_url + ' -',
|
||||
shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
stdout = cmd_process.communicate(input=json.dumps(environment))
|
||||
|
||||
|
|
Loading…
Reference in New Issue