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)
|
||||
resp = {}
|
||||
if body.get('type') == 'aws':
|
||||
is_auth = RemoteRunAwsService.update_aws_auth_params()
|
||||
resp['auth'] = is_auth
|
||||
if is_auth:
|
||||
result = self.run_aws_monkeys(body)
|
||||
resp['result'] = result
|
||||
else:
|
||||
#is_auth = RemoteRunAwsService.update_aws_auth_params()
|
||||
#resp['auth'] = is_auth
|
||||
#if is_auth:
|
||||
# result = self.run_aws_monkeys(body)
|
||||
# resp['result'] = result
|
||||
#else:
|
||||
RemoteRunAwsService.update_aws_region_authless()
|
||||
result = self.run_aws_monkeys(body)
|
||||
resp['result'] = result
|
||||
return jsonify(resp)
|
||||
|
|
|
@ -62,6 +62,13 @@ class RemoteRunAwsService:
|
|||
|
||||
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
|
||||
def get_bitness(instances):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue