Browse Source

update send_request

xuekailun 4 tháng trước cách đây
mục cha
commit
df5ae48563
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      utils.py

+ 4 - 4
utils.py

@@ -276,16 +276,16 @@ def stop_instances(ecs_client, instance_ids, force_stop=False):
 
 
 
-def send_request(client, request):
+def send_request(ecs_client, request):
     """
     发送API请求
-    :param client: 客户端连接
+    :param ecs_client: 客户端连接
     :param request: 请求配置
     :return: response
     """
     request.set_accept_format('json')
     try:
-        response = client.do_action_with_exception(request)
+        response = ecs_client.do_action_with_exception(request)
         response = json.loads(response)
         # logging.info(response)
         return response
@@ -313,7 +313,7 @@ def run_command(ecs_client, instance_ids, command):
         request.set_Type("RunShellScript")
         request.set_CommandContent(command)
         request.set_InstanceIds(instance_id_list)
-        response = send_request(client=ecs_client, request=request)
+        response = send_request(ecs_client=ecs_client, request=request)
         logging.info(response)