forked from p15670423/monkey
Trying to update the region and then to call remote run
Without auth first
This commit is contained in:
parent
4741151f22
commit
6216ac0e9e
|
@ -45,12 +45,13 @@ class RemoteRun(flask_restful.Resource):
|
||||||
body = json.loads(request.data)
|
body = json.loads(request.data)
|
||||||
resp = {}
|
resp = {}
|
||||||
if body.get('type') == 'aws':
|
if body.get('type') == 'aws':
|
||||||
is_auth = RemoteRunAwsService.update_aws_auth_params()
|
#is_auth = RemoteRunAwsService.update_aws_auth_params()
|
||||||
resp['auth'] = is_auth
|
#resp['auth'] = is_auth
|
||||||
if is_auth:
|
#if is_auth:
|
||||||
result = self.run_aws_monkeys(body)
|
# result = self.run_aws_monkeys(body)
|
||||||
resp['result'] = result
|
# resp['result'] = result
|
||||||
else:
|
#else:
|
||||||
|
RemoteRunAwsService.update_aws_region_authless()
|
||||||
result = self.run_aws_monkeys(body)
|
result = self.run_aws_monkeys(body)
|
||||||
resp['result'] = result
|
resp['result'] = result
|
||||||
return jsonify(resp)
|
return jsonify(resp)
|
||||||
|
|
|
@ -62,6 +62,13 @@ class RemoteRunAwsService:
|
||||||
|
|
||||||
return RemoteRunAwsService.is_auth
|
return RemoteRunAwsService.is_auth
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def update_aws_region_authless():
|
||||||
|
"""
|
||||||
|
Updates the AWS region without auth params (via IAM role)
|
||||||
|
"""
|
||||||
|
AwsService.set_region(RemoteRunAwsService.aws_instance.region)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_bitness(instances):
|
def get_bitness(instances):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue