diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 6a1bf6ad..b107e1fa 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -274,8 +274,8 @@ def __init__(self, config): self.RE_BACKEND_URL = cfg["forc"]["forc_url"] backend_url_host = self.RE_BACKEND_URL.split(":") self.FORC_URL = ( - cfg["forc"].get("openresty_url", None) - or f"https:{backend_url_host[1]}/" + cfg["forc"].get("openresty_url", None) + or f"https:{backend_url_host[1]}/" ) self.FORC_API_KEY = os.environ.get("FORC_API_KEY", None) @@ -284,9 +284,9 @@ def __init__(self, config): self.FORC_REMOTE_ID = cfg["forc"]["forc_remote_id"] self.GITHUB_PLAYBOOKS_REPO = cfg["forc"]["github_playbooks_repo"] if ( - not self.RE_BACKEND_URL - or not self.FORC_API_KEY - or not self.GITHUB_PLAYBOOKS_REPO + not self.RE_BACKEND_URL + or not self.FORC_API_KEY + or not self.GITHUB_PLAYBOOKS_REPO ): raise ValueError self.LOG.info(msg=f"Forc-Backend url loaded: {self.RE_BACKEND_URL}") @@ -431,10 +431,10 @@ def get_Images(self): images = list() try: for img in filter( - lambda x: "tags" in x - and len(x["tags"]) > 0 - and x["status"] == "active", - self.conn.list_images(), + lambda x: "tags" in x + and len(x["tags"]) > 0 + and x["status"] == "active", + self.conn.list_images(), ): properties = img.get("properties") if not properties: @@ -444,7 +444,7 @@ def get_Images(self): tags = img.get("tags", []) self.LOG.info(set(self.ALL_TEMPLATES).intersection(tags)) if len( - set(self.ALL_TEMPLATES).intersection(tags) + set(self.ALL_TEMPLATES).intersection(tags) ) > 0 and not self.cross_check_forc_image(tags): self.LOG.info(f"Resenv check: Skipping {img['name']}.") continue @@ -485,7 +485,7 @@ def prepare_image(self, img): tags = img.get("tags", []) self.LOG.info(set(self.ALL_TEMPLATES).intersection(tags)) if len( - set(self.ALL_TEMPLATES).intersection(tags) + set(self.ALL_TEMPLATES).intersection(tags) ) > 0 and not self.cross_check_forc_image(tags): self.LOG.info(f"Resenv check: Skipping {img['name']}.") return None @@ -525,11 +525,11 @@ def get_public_Images(self): images = list() try: for img in filter( - lambda x: "tags" in x - and len(x["tags"]) > 0 - and x["status"] == "active" - and x["visibility"] == "public", - self.conn.list_images(), + lambda x: "tags" in x + and len(x["tags"]) > 0 + and x["status"] == "active" + and x["visibility"] == "public", + self.conn.list_images(), ): image = self.prepare_image(img) if image is None: @@ -551,11 +551,11 @@ def get_private_Images(self): images = list() try: for img in filter( - lambda x: "tags" in x - and len(x["tags"]) > 0 - and x["status"] == "active" - and x["visibility"] == "private", - self.conn.list_images(), + lambda x: "tags" in x + and len(x["tags"]) > 0 + and x["status"] == "active" + and x["visibility"] == "private", + self.conn.list_images(), ): image = self.prepare_image(img) if image is None: @@ -613,10 +613,10 @@ def get_Images_by_filter(self, filter_list): images = list() try: for img in filter( - lambda x: "tags" in x - and len(x["tags"]) > 0 - and x["status"] == "active", - self.conn.list_images(), + lambda x: "tags" in x + and len(x["tags"]) > 0 + and x["status"] == "active", + self.conn.list_images(), ): tags = img.get("tags", []) if "resenv" in filter_list: @@ -812,7 +812,7 @@ def create_add_keys_script(self, keys): return key_script def create_mount_init_script( - self, volume_ids_path_new=None, volume_ids_path_attach=None + self, volume_ids_path_new=None, volume_ids_path_attach=None ): self.LOG.info(f"create init script for volume ids:{volume_ids_path_new}") if not volume_ids_path_new and not volume_ids_path_attach: @@ -957,17 +957,17 @@ def create_volume(self, volume_name, volume_storage, metadata): raise ressourceException(Reason=str(e)) def volume_ids( - self, - flavor, - image, - public_key, - servername, - metadata, - https, - http, - resenv, - volume_ids_path_new, - volume_ids_path_attach, + self, + flavor, + image, + public_key, + servername, + metadata, + https, + http, + resenv, + volume_ids_path_new, + volume_ids_path_attach, ): image = self.get_image(image=image) flavor = self.get_flavor(flavor=flavor) @@ -1051,7 +1051,7 @@ def get_or_create_project_security_group(self, project_name, project_id): return new_security_group["id"] def get_research_environment_security_groups( - self, research_environment_names: list[str] + self, research_environment_names: list[str] ): custom_security_groups = [] @@ -1072,18 +1072,18 @@ def get_research_environment_security_groups( return custom_security_groups def start_server_without_playbook( - self, - flavor, - image, - public_key, - servername, - metadata, - https, - http, - resenv, - volume_ids_path_new=None, - volume_ids_path_attach=None, - additional_keys=None, + self, + flavor, + image, + public_key, + servername, + metadata, + https, + http, + resenv, + volume_ids_path_new=None, + volume_ids_path_attach=None, + additional_keys=None, ): """ Start a new Server. @@ -1144,17 +1144,17 @@ def start_server_without_playbook( if init_script: add_key_script = self.create_add_keys_script(keys=additional_keys) init_script = ( - add_key_script - + encodeutils.safe_encode("\n".encode("utf-8")) - + unlock_ubuntu_user_script - + init_script + add_key_script + + encodeutils.safe_encode("\n".encode("utf-8")) + + unlock_ubuntu_user_script + + init_script ) else: init_script = ( - self.create_add_keys_script(keys=additional_keys) - + encodeutils.safe_encode("\n".encode("utf-8")) - + unlock_ubuntu_user_script + self.create_add_keys_script(keys=additional_keys) + + encodeutils.safe_encode("\n".encode("utf-8")) + + unlock_ubuntu_user_script ) server = self.conn.create_server( @@ -1180,17 +1180,17 @@ def start_server_without_playbook( return {} def start_server( - self, - flavor, - image, - public_key, - servername, - metadata, - diskspace, - volumename, - https, - http, - resenv, + self, + flavor, + image, + public_key, + servername, + metadata, + diskspace, + volumename, + https, + http, + resenv, ): """ Start a new Server. @@ -1250,7 +1250,7 @@ def start_server( return {} def create_resenv_security_group_and_attach_to_server( - self, server_id: str, resenv_template: str + self, server_id: str, resenv_template: str ): self.LOG.info( f"Create {resenv_template} Security Group for Instance: {server_id}" @@ -1280,16 +1280,16 @@ def create_resenv_security_group_and_attach_to_server( ) def start_server_with_custom_key( - self, - flavor, - image, - servername, - metadata, - http, - https, - resenv, - volume_ids_path_new=None, - volume_ids_path_attach=None, + self, + flavor, + image, + servername, + metadata, + http, + https, + resenv, + volume_ids_path_new=None, + volume_ids_path_attach=None, ): """ Start a new Server. @@ -1370,7 +1370,7 @@ def start_server_with_custom_key( return {} def create_and_deploy_playbook( - self, public_key, playbooks_information, openstack_id + self, public_key, playbooks_information, openstack_id ): global active_playbooks self.LOG.info( @@ -1425,8 +1425,8 @@ def cross_check_forc_image(self, tags): cross_tags = list(set(self.ALL_TEMPLATES).intersection(tags)) for template_dict in templates: if ( - template_dict["name"] in self.FORC_ALLOWED - and template_dict["name"] in cross_tags + template_dict["name"] in self.FORC_ALLOWED + and template_dict["name"] in cross_tags ): if template_dict["version"] in self.FORC_ALLOWED[template_dict["name"]]: return True @@ -1879,7 +1879,7 @@ def check_server_status(self, openstack_id: str) -> VM: serv = server.to_dict() try: - if serv["status"] == self.ACTIVE: + if serv["status"] == self.ACTIVE and serv["task_state"] not in ["powering-off", "powering-on"]: host = self.get_server(openstack_id).floating_ip port = self.SSH_PORT @@ -1897,7 +1897,6 @@ def check_server_status(self, openstack_id: str) -> VM: ) if self.netcat(host, port): server = self.get_server(openstack_id) - if self.redis.exists(openstack_id) == 1: global active_playbooks if openstack_id in active_playbooks: @@ -1918,7 +1917,8 @@ def check_server_status(self, openstack_id: str) -> VM: return self.get_server(openstack_id) else: server = self.get_server(openstack_id) - server.status = "PORT_CLOSED" + if server.status != "SHUTDOWN": + server.status = "PORT_CLOSED" return server elif serv["status"] == self.ERROR: server = self.get_server(openstack_id) @@ -2200,7 +2200,7 @@ def get_active_image_by_os_version(self, os_version, os_distro): return None def get_active_image_by_os_version_and_slurm_version( - self, os_version, os_distro, slurm_version + self, os_version, os_distro, slurm_version ): # 18.04 deprecated if os_version == "18.04": @@ -2232,20 +2232,20 @@ def create_deactivate_update_script(self): return deactivate_update_script def add_cluster_machine( - self, - cluster_id, - cluster_user, - cluster_group_id, - image, - flavor, - name, - key_name, - batch_idx, - worker_idx, - pub_key, - project_name, - project_id, - slurm_version, + self, + cluster_id, + cluster_user, + cluster_group_id, + image, + flavor, + name, + key_name, + batch_idx, + worker_idx, + pub_key, + project_name, + project_id, + slurm_version, ): self.LOG.info( f"Add machine to [{name}] {cluster_id} - [Image: {image}] - {key_name}" @@ -2528,12 +2528,18 @@ def netcat(self, host, port): :return: True if successfully connected, False if not """ self.LOG.info(f"Checking SSH Connection {host}:{port}") + with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock: - r = sock.connect_ex((host, port)) - self.LOG.info(f"Checking SSH Connection {host}:{port} Result = {r}") - if r == 0: - return True - else: + sock.settimeout(5) + try: + r = sock.connect_ex((host, port)) + self.LOG.info(f"Checking SSH Connection {host}:{port} Result = {r}") + if r == 0: + return True + else: + return False + except socket.timeout: + self.LOG.info(f"Connection to {host}:{port} timed out") return False def is_security_group_in_use(self, security_group_id): @@ -2597,9 +2603,9 @@ def delete_server(self, openstack_id): return True task_state = self.check_server_task_state(openstack_id) if ( - task_state == "image_snapshot" - or task_state == "image_pending_upload" - or task_state == "image_uploading" + task_state == "image_snapshot" + or task_state == "image_pending_upload" + or task_state == "image_uploading" ): raise ConflictException("task_state in image creating") security_groups = self.conn.list_server_security_groups(server=server) @@ -2610,11 +2616,11 @@ def delete_server(self, openstack_id): ) if ( - sg["name"] != self.DEFAULT_SECURITY_GROUP_NAME - and "bibigrid" not in sg["name"] - and not self.is_security_group_in_use( - security_group_id=sg["id"] - ) + sg["name"] != self.DEFAULT_SECURITY_GROUP_NAME + and "bibigrid" not in sg["name"] + and not self.is_security_group_in_use( + security_group_id=sg["id"] + ) ): self.LOG.info(f"Delete security group {sg['name']}") @@ -2784,15 +2790,15 @@ def create_or_get_default_ssh_security_group(self): ) def create_security_group( - self, - name, - udp_port=None, - ssh=True, - http=False, - https=False, - udp=False, - description=None, - resenv=[], + self, + name, + udp_port=None, + ssh=True, + http=False, + https=False, + udp=False, + description=None, + resenv=[], ): self.LOG.info(f"Create new security group {name}") sec = self.conn.get_security_group(name_or_id=name) @@ -2979,7 +2985,7 @@ def update_playbooks(self): name for name in os.listdir(PLAYBOOKS_DIR) if name not in ["optional", "packer", ".github", "cluster"] - and os.path.isdir(os.path.join(PLAYBOOKS_DIR, name)) + and os.path.isdir(os.path.join(PLAYBOOKS_DIR, name)) ] self.LOG.info(self.ALL_TEMPLATES) @@ -3031,7 +3037,7 @@ def load_resenv_metadata(self): for template in self.ALL_TEMPLATES: try: with open( - f"{PLAYBOOKS_DIR}{template}/{template}_metadata.yml" + f"{PLAYBOOKS_DIR}{template}/{template}_metadata.yml" ) as template_metadata: try: loaded_metadata = yaml.load( @@ -3052,7 +3058,7 @@ def load_resenv_metadata(self): return templates_metada def get_or_create_research_environment_security_group( - self, resenv_metadata: ResearchEnvironmentMetadata + self, resenv_metadata: ResearchEnvironmentMetadata ): if not resenv_metadata.needs_forc_support: return None diff --git a/VirtualMachineService/VirtualMachineService-remote b/VirtualMachineService/VirtualMachineService-remote index 4caef159..95c0b8c2 100755 --- a/VirtualMachineService/VirtualMachineService-remote +++ b/VirtualMachineService/VirtualMachineService-remote @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Autogenerated by Thrift Compiler (0.16.0) +# Autogenerated by Thrift Compiler (0.17.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # diff --git a/VirtualMachineService/__init__.py b/VirtualMachineService/__init__.py index ba9c185a..86a570c6 100644 --- a/VirtualMachineService/__init__.py +++ b/VirtualMachineService/__init__.py @@ -1 +1 @@ -__all__ = ["ttypes", "constants", "VirtualMachineService"] +__all__ = ['ttypes', 'constants', 'VirtualMachineService'] diff --git a/VirtualMachineService/constants.py b/VirtualMachineService/constants.py index a334d1fc..57f42fc1 100644 --- a/VirtualMachineService/constants.py +++ b/VirtualMachineService/constants.py @@ -1,22 +1,15 @@ # -# Autogenerated by Thrift Compiler (0.16.0) +# Autogenerated by Thrift Compiler (0.17.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # -from thrift.Thrift import ( - TType, - TMessageType, - TFrozenDict, - TException, - TApplicationException, -) +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from ttypes import * - VERSION = "1.0.0" diff --git a/VirtualMachineService/ttypes.py b/VirtualMachineService/ttypes.py index 6ab72f3a..b652b26b 100644 --- a/VirtualMachineService/ttypes.py +++ b/VirtualMachineService/ttypes.py @@ -1,25 +1,18 @@ # -# Autogenerated by Thrift Compiler (0.16.0) +# Autogenerated by Thrift Compiler (0.17.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # -from thrift.Thrift import ( - TType, - TMessageType, - TFrozenDict, - TException, - TApplicationException, -) +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from thrift.transport import TTransport - all_structs = [] @@ -34,14 +27,8 @@ class Backend(object): """ - def __init__( - self, - id=None, - owner=None, - location_url=None, - template=None, - template_version=None, - ): + + def __init__(self, id=None, owner=None, location_url=None, template=None, template_version=None,): self.id = id self.owner = owner self.location_url = location_url @@ -49,11 +36,7 @@ def __init__( self.template_version = template_version def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -68,38 +51,22 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.owner = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.owner = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.location_url = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.location_url = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.template = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.template = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.template_version = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.template_version = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -109,44 +76,28 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("Backend") + oprot.writeStructBegin('Backend') if self.id is not None: - oprot.writeFieldBegin("id", TType.I64, 1) + oprot.writeFieldBegin('id', TType.I64, 1) oprot.writeI64(self.id) oprot.writeFieldEnd() if self.owner is not None: - oprot.writeFieldBegin("owner", TType.STRING, 2) - oprot.writeString( - self.owner.encode("utf-8") if sys.version_info[0] == 2 else self.owner - ) + oprot.writeFieldBegin('owner', TType.STRING, 2) + oprot.writeString(self.owner.encode('utf-8') if sys.version_info[0] == 2 else self.owner) oprot.writeFieldEnd() if self.location_url is not None: - oprot.writeFieldBegin("location_url", TType.STRING, 3) - oprot.writeString( - self.location_url.encode("utf-8") - if sys.version_info[0] == 2 - else self.location_url - ) + oprot.writeFieldBegin('location_url', TType.STRING, 3) + oprot.writeString(self.location_url.encode('utf-8') if sys.version_info[0] == 2 else self.location_url) oprot.writeFieldEnd() if self.template is not None: - oprot.writeFieldBegin("template", TType.STRING, 4) - oprot.writeString( - self.template.encode("utf-8") - if sys.version_info[0] == 2 - else self.template - ) + oprot.writeFieldBegin('template', TType.STRING, 4) + oprot.writeString(self.template.encode('utf-8') if sys.version_info[0] == 2 else self.template) oprot.writeFieldEnd() if self.template_version is not None: - oprot.writeFieldBegin("template_version", TType.STRING, 5) - oprot.writeString( - self.template_version.encode("utf-8") - if sys.version_info[0] == 2 - else self.template_version - ) + oprot.writeFieldBegin('template_version', TType.STRING, 5) + oprot.writeString(self.template_version.encode('utf-8') if sys.version_info[0] == 2 else self.template_version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -155,8 +106,9 @@ def validate(self): return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -181,19 +133,8 @@ class ClusterInfo(object): """ - def __init__( - self, - launch_date=None, - group_id=None, - network_id=None, - public_ip=None, - subnet_id=None, - user=None, - inst_counter=None, - cluster_id=None, - key_name=None, - pub_key=None, - ): + + def __init__(self, launch_date=None, group_id=None, network_id=None, public_ip=None, subnet_id=None, user=None, inst_counter=None, cluster_id=None, key_name=None, pub_key=None,): self.launch_date = launch_date self.group_id = group_id self.network_id = network_id @@ -206,11 +147,7 @@ def __init__( self.pub_key = pub_key def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -220,56 +157,32 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.launch_date = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.launch_date = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.group_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.group_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.network_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.network_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.public_ip = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.public_ip = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.subnet_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.subnet_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.user = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.user = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: @@ -279,29 +192,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.cluster_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.cluster_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: - self.key_name = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.key_name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: - self.pub_key = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.pub_key = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -311,84 +212,48 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("ClusterInfo") + oprot.writeStructBegin('ClusterInfo') if self.launch_date is not None: - oprot.writeFieldBegin("launch_date", TType.STRING, 1) - oprot.writeString( - self.launch_date.encode("utf-8") - if sys.version_info[0] == 2 - else self.launch_date - ) + oprot.writeFieldBegin('launch_date', TType.STRING, 1) + oprot.writeString(self.launch_date.encode('utf-8') if sys.version_info[0] == 2 else self.launch_date) oprot.writeFieldEnd() if self.group_id is not None: - oprot.writeFieldBegin("group_id", TType.STRING, 2) - oprot.writeString( - self.group_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.group_id - ) + oprot.writeFieldBegin('group_id', TType.STRING, 2) + oprot.writeString(self.group_id.encode('utf-8') if sys.version_info[0] == 2 else self.group_id) oprot.writeFieldEnd() if self.network_id is not None: - oprot.writeFieldBegin("network_id", TType.STRING, 3) - oprot.writeString( - self.network_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.network_id - ) + oprot.writeFieldBegin('network_id', TType.STRING, 3) + oprot.writeString(self.network_id.encode('utf-8') if sys.version_info[0] == 2 else self.network_id) oprot.writeFieldEnd() if self.public_ip is not None: - oprot.writeFieldBegin("public_ip", TType.STRING, 4) - oprot.writeString( - self.public_ip.encode("utf-8") - if sys.version_info[0] == 2 - else self.public_ip - ) + oprot.writeFieldBegin('public_ip', TType.STRING, 4) + oprot.writeString(self.public_ip.encode('utf-8') if sys.version_info[0] == 2 else self.public_ip) oprot.writeFieldEnd() if self.subnet_id is not None: - oprot.writeFieldBegin("subnet_id", TType.STRING, 5) - oprot.writeString( - self.subnet_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.subnet_id - ) + oprot.writeFieldBegin('subnet_id', TType.STRING, 5) + oprot.writeString(self.subnet_id.encode('utf-8') if sys.version_info[0] == 2 else self.subnet_id) oprot.writeFieldEnd() if self.user is not None: - oprot.writeFieldBegin("user", TType.STRING, 6) - oprot.writeString( - self.user.encode("utf-8") if sys.version_info[0] == 2 else self.user - ) + oprot.writeFieldBegin('user', TType.STRING, 6) + oprot.writeString(self.user.encode('utf-8') if sys.version_info[0] == 2 else self.user) oprot.writeFieldEnd() if self.inst_counter is not None: - oprot.writeFieldBegin("inst_counter", TType.I32, 7) + oprot.writeFieldBegin('inst_counter', TType.I32, 7) oprot.writeI32(self.inst_counter) oprot.writeFieldEnd() if self.cluster_id is not None: - oprot.writeFieldBegin("cluster_id", TType.STRING, 8) - oprot.writeString( - self.cluster_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.cluster_id - ) + oprot.writeFieldBegin('cluster_id', TType.STRING, 8) + oprot.writeString(self.cluster_id.encode('utf-8') if sys.version_info[0] == 2 else self.cluster_id) oprot.writeFieldEnd() if self.key_name is not None: - oprot.writeFieldBegin("key_name", TType.STRING, 9) - oprot.writeString( - self.key_name.encode("utf-8") - if sys.version_info[0] == 2 - else self.key_name - ) + oprot.writeFieldBegin('key_name', TType.STRING, 9) + oprot.writeString(self.key_name.encode('utf-8') if sys.version_info[0] == 2 else self.key_name) oprot.writeFieldEnd() if self.pub_key is not None: - oprot.writeFieldBegin("pub_key", TType.STRING, 10) - oprot.writeString( - self.pub_key.encode("utf-8") - if sys.version_info[0] == 2 - else self.pub_key - ) + oprot.writeFieldBegin('pub_key', TType.STRING, 10) + oprot.writeString(self.pub_key.encode('utf-8') if sys.version_info[0] == 2 else self.pub_key) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -397,8 +262,9 @@ def validate(self): return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -421,17 +287,8 @@ class Volume(object): """ - def __init__( - self, - id=None, - name=None, - description=None, - status=None, - created_at=None, - device=None, - size=None, - server_id=None, - ): + + def __init__(self, id=None, name=None, description=None, status=None, created_at=None, device=None, size=None, server_id=None,): self.id = id self.name = name self.description = description @@ -442,11 +299,7 @@ def __init__( self.server_id = server_id def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -456,56 +309,32 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.name = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.description = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.description = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.status = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.status = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.created_at = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.created_at = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.device = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.device = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: @@ -515,11 +344,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.server_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.server_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -529,62 +354,40 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("Volume") + oprot.writeStructBegin('Volume') if self.id is not None: - oprot.writeFieldBegin("id", TType.STRING, 1) - oprot.writeString( - self.id.encode("utf-8") if sys.version_info[0] == 2 else self.id - ) + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8') if sys.version_info[0] == 2 else self.id) oprot.writeFieldEnd() if self.name is not None: - oprot.writeFieldBegin("name", TType.STRING, 2) - oprot.writeString( - self.name.encode("utf-8") if sys.version_info[0] == 2 else self.name - ) + oprot.writeFieldBegin('name', TType.STRING, 2) + oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.description is not None: - oprot.writeFieldBegin("description", TType.STRING, 3) - oprot.writeString( - self.description.encode("utf-8") - if sys.version_info[0] == 2 - else self.description - ) + oprot.writeFieldBegin('description', TType.STRING, 3) + oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description) oprot.writeFieldEnd() if self.status is not None: - oprot.writeFieldBegin("status", TType.STRING, 4) - oprot.writeString( - self.status.encode("utf-8") if sys.version_info[0] == 2 else self.status - ) + oprot.writeFieldBegin('status', TType.STRING, 4) + oprot.writeString(self.status.encode('utf-8') if sys.version_info[0] == 2 else self.status) oprot.writeFieldEnd() if self.created_at is not None: - oprot.writeFieldBegin("created_at", TType.STRING, 5) - oprot.writeString( - self.created_at.encode("utf-8") - if sys.version_info[0] == 2 - else self.created_at - ) + oprot.writeFieldBegin('created_at', TType.STRING, 5) + oprot.writeString(self.created_at.encode('utf-8') if sys.version_info[0] == 2 else self.created_at) oprot.writeFieldEnd() if self.device is not None: - oprot.writeFieldBegin("device", TType.STRING, 6) - oprot.writeString( - self.device.encode("utf-8") if sys.version_info[0] == 2 else self.device - ) + oprot.writeFieldBegin('device', TType.STRING, 6) + oprot.writeString(self.device.encode('utf-8') if sys.version_info[0] == 2 else self.device) oprot.writeFieldEnd() if self.size is not None: - oprot.writeFieldBegin("size", TType.I32, 7) + oprot.writeFieldBegin('size', TType.I32, 7) oprot.writeI32(self.size) oprot.writeFieldEnd() if self.server_id is not None: - oprot.writeFieldBegin("server_id", TType.STRING, 8) - oprot.writeString( - self.server_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.server_id - ) + oprot.writeFieldBegin('server_id', TType.STRING, 8) + oprot.writeString(self.server_id.encode('utf-8') if sys.version_info[0] == 2 else self.server_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -593,8 +396,9 @@ def validate(self): return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -619,17 +423,8 @@ class Flavor(object): """ - def __init__( - self, - vcpus=None, - ram=None, - disk=None, - name=None, - openstack_id=None, - description=None, - tags=None, - ephemeral_disk=None, - ): + + def __init__(self, vcpus=None, ram=None, disk=None, name=None, openstack_id=None, description=None, tags=None, ephemeral_disk=None,): self.vcpus = vcpus self.ram = ram self.disk = disk @@ -640,11 +435,7 @@ def __init__( self.ephemeral_disk = ephemeral_disk def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -669,29 +460,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.name = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.openstack_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.openstack_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.description = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.description = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: @@ -699,11 +478,7 @@ def read(self, iprot): self.tags = [] (_etype3, _size0) = iprot.readListBegin() for _i4 in range(_size0): - _elem5 = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + _elem5 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() self.tags.append(_elem5) iprot.readListEnd() else: @@ -720,56 +495,42 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("Flavor") + oprot.writeStructBegin('Flavor') if self.vcpus is not None: - oprot.writeFieldBegin("vcpus", TType.I32, 1) + oprot.writeFieldBegin('vcpus', TType.I32, 1) oprot.writeI32(self.vcpus) oprot.writeFieldEnd() if self.ram is not None: - oprot.writeFieldBegin("ram", TType.I32, 2) + oprot.writeFieldBegin('ram', TType.I32, 2) oprot.writeI32(self.ram) oprot.writeFieldEnd() if self.disk is not None: - oprot.writeFieldBegin("disk", TType.I32, 3) + oprot.writeFieldBegin('disk', TType.I32, 3) oprot.writeI32(self.disk) oprot.writeFieldEnd() if self.name is not None: - oprot.writeFieldBegin("name", TType.STRING, 4) - oprot.writeString( - self.name.encode("utf-8") if sys.version_info[0] == 2 else self.name - ) + oprot.writeFieldBegin('name', TType.STRING, 4) + oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.openstack_id is not None: - oprot.writeFieldBegin("openstack_id", TType.STRING, 5) - oprot.writeString( - self.openstack_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.openstack_id - ) + oprot.writeFieldBegin('openstack_id', TType.STRING, 5) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) oprot.writeFieldEnd() if self.description is not None: - oprot.writeFieldBegin("description", TType.STRING, 6) - oprot.writeString( - self.description.encode("utf-8") - if sys.version_info[0] == 2 - else self.description - ) + oprot.writeFieldBegin('description', TType.STRING, 6) + oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description) oprot.writeFieldEnd() if self.tags is not None: - oprot.writeFieldBegin("tags", TType.LIST, 7) + oprot.writeFieldBegin('tags', TType.LIST, 7) oprot.writeListBegin(TType.STRING, len(self.tags)) for iter6 in self.tags: - oprot.writeString( - iter6.encode("utf-8") if sys.version_info[0] == 2 else iter6 - ) + oprot.writeString(iter6.encode('utf-8') if sys.version_info[0] == 2 else iter6) oprot.writeListEnd() oprot.writeFieldEnd() if self.ephemeral_disk is not None: - oprot.writeFieldBegin("ephemeral_disk", TType.I32, 8) + oprot.writeFieldBegin('ephemeral_disk', TType.I32, 8) oprot.writeI32(self.ephemeral_disk) oprot.writeFieldEnd() oprot.writeFieldStop() @@ -777,22 +538,23 @@ def write(self, oprot): def validate(self): if self.vcpus is None: - raise TProtocolException(message="Required field vcpus is unset!") + raise TProtocolException(message='Required field vcpus is unset!') if self.ram is None: - raise TProtocolException(message="Required field ram is unset!") + raise TProtocolException(message='Required field ram is unset!') if self.disk is None: - raise TProtocolException(message="Required field disk is unset!") + raise TProtocolException(message='Required field disk is unset!') if self.name is None: - raise TProtocolException(message="Required field name is unset!") + raise TProtocolException(message='Required field name is unset!') if self.openstack_id is None: - raise TProtocolException(message="Required field openstack_id is unset!") + raise TProtocolException(message='Required field openstack_id is unset!') if self.tags is None: - raise TProtocolException(message="Required field tags is unset!") + raise TProtocolException(message='Required field tags is unset!') return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -822,22 +584,8 @@ class Image(object): """ - def __init__( - self, - name=None, - min_disk=None, - min_ram=None, - status=None, - created_at=None, - updated_at=None, - openstack_id=None, - description=None, - tag=None, - is_snapshot=None, - os_version=None, - os_distro=None, - slurm_version=None, - ): + + def __init__(self, name=None, min_disk=None, min_ram=None, status=None, created_at=None, updated_at=None, openstack_id=None, description=None, tag=None, is_snapshot=None, os_version=None, os_distro=None, slurm_version=None,): self.name = name self.min_disk = min_disk self.min_ram = min_ram @@ -853,11 +601,7 @@ def __init__( self.slurm_version = slurm_version def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -867,11 +611,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.name = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: @@ -886,47 +626,27 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.status = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.status = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.created_at = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.created_at = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.updated_at = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.updated_at = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: - self.openstack_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.openstack_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.description = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.description = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: @@ -934,11 +654,7 @@ def read(self, iprot): self.tag = [] (_etype10, _size7) = iprot.readListBegin() for _i11 in range(_size7): - _elem12 = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + _elem12 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() self.tag.append(_elem12) iprot.readListEnd() else: @@ -950,29 +666,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: - self.os_version = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.os_version = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: - self.os_distro = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.os_distro = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: - self.slurm_version = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.slurm_version = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -982,121 +686,86 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("Image") + oprot.writeStructBegin('Image') if self.name is not None: - oprot.writeFieldBegin("name", TType.STRING, 1) - oprot.writeString( - self.name.encode("utf-8") if sys.version_info[0] == 2 else self.name - ) + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.min_disk is not None: - oprot.writeFieldBegin("min_disk", TType.I32, 2) + oprot.writeFieldBegin('min_disk', TType.I32, 2) oprot.writeI32(self.min_disk) oprot.writeFieldEnd() if self.min_ram is not None: - oprot.writeFieldBegin("min_ram", TType.I32, 3) + oprot.writeFieldBegin('min_ram', TType.I32, 3) oprot.writeI32(self.min_ram) oprot.writeFieldEnd() if self.status is not None: - oprot.writeFieldBegin("status", TType.STRING, 4) - oprot.writeString( - self.status.encode("utf-8") if sys.version_info[0] == 2 else self.status - ) + oprot.writeFieldBegin('status', TType.STRING, 4) + oprot.writeString(self.status.encode('utf-8') if sys.version_info[0] == 2 else self.status) oprot.writeFieldEnd() if self.created_at is not None: - oprot.writeFieldBegin("created_at", TType.STRING, 5) - oprot.writeString( - self.created_at.encode("utf-8") - if sys.version_info[0] == 2 - else self.created_at - ) + oprot.writeFieldBegin('created_at', TType.STRING, 5) + oprot.writeString(self.created_at.encode('utf-8') if sys.version_info[0] == 2 else self.created_at) oprot.writeFieldEnd() if self.updated_at is not None: - oprot.writeFieldBegin("updated_at", TType.STRING, 6) - oprot.writeString( - self.updated_at.encode("utf-8") - if sys.version_info[0] == 2 - else self.updated_at - ) + oprot.writeFieldBegin('updated_at', TType.STRING, 6) + oprot.writeString(self.updated_at.encode('utf-8') if sys.version_info[0] == 2 else self.updated_at) oprot.writeFieldEnd() if self.openstack_id is not None: - oprot.writeFieldBegin("openstack_id", TType.STRING, 7) - oprot.writeString( - self.openstack_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.openstack_id - ) + oprot.writeFieldBegin('openstack_id', TType.STRING, 7) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) oprot.writeFieldEnd() if self.description is not None: - oprot.writeFieldBegin("description", TType.STRING, 8) - oprot.writeString( - self.description.encode("utf-8") - if sys.version_info[0] == 2 - else self.description - ) + oprot.writeFieldBegin('description', TType.STRING, 8) + oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description) oprot.writeFieldEnd() if self.tag is not None: - oprot.writeFieldBegin("tag", TType.LIST, 9) + oprot.writeFieldBegin('tag', TType.LIST, 9) oprot.writeListBegin(TType.STRING, len(self.tag)) for iter13 in self.tag: - oprot.writeString( - iter13.encode("utf-8") if sys.version_info[0] == 2 else iter13 - ) + oprot.writeString(iter13.encode('utf-8') if sys.version_info[0] == 2 else iter13) oprot.writeListEnd() oprot.writeFieldEnd() if self.is_snapshot is not None: - oprot.writeFieldBegin("is_snapshot", TType.BOOL, 10) + oprot.writeFieldBegin('is_snapshot', TType.BOOL, 10) oprot.writeBool(self.is_snapshot) oprot.writeFieldEnd() if self.os_version is not None: - oprot.writeFieldBegin("os_version", TType.STRING, 11) - oprot.writeString( - self.os_version.encode("utf-8") - if sys.version_info[0] == 2 - else self.os_version - ) + oprot.writeFieldBegin('os_version', TType.STRING, 11) + oprot.writeString(self.os_version.encode('utf-8') if sys.version_info[0] == 2 else self.os_version) oprot.writeFieldEnd() if self.os_distro is not None: - oprot.writeFieldBegin("os_distro", TType.STRING, 12) - oprot.writeString( - self.os_distro.encode("utf-8") - if sys.version_info[0] == 2 - else self.os_distro - ) + oprot.writeFieldBegin('os_distro', TType.STRING, 12) + oprot.writeString(self.os_distro.encode('utf-8') if sys.version_info[0] == 2 else self.os_distro) oprot.writeFieldEnd() if self.slurm_version is not None: - oprot.writeFieldBegin("slurm_version", TType.STRING, 13) - oprot.writeString( - self.slurm_version.encode("utf-8") - if sys.version_info[0] == 2 - else self.slurm_version - ) + oprot.writeFieldBegin('slurm_version', TType.STRING, 13) + oprot.writeString(self.slurm_version.encode('utf-8') if sys.version_info[0] == 2 else self.slurm_version) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.name is None: - raise TProtocolException(message="Required field name is unset!") + raise TProtocolException(message='Required field name is unset!') if self.min_disk is None: - raise TProtocolException(message="Required field min_disk is unset!") + raise TProtocolException(message='Required field min_disk is unset!') if self.min_ram is None: - raise TProtocolException(message="Required field min_ram is unset!") + raise TProtocolException(message='Required field min_ram is unset!') if self.status is None: - raise TProtocolException(message="Required field status is unset!") + raise TProtocolException(message='Required field status is unset!') if self.openstack_id is None: - raise TProtocolException(message="Required field openstack_id is unset!") + raise TProtocolException(message='Required field openstack_id is unset!') if self.tag is None: - raise TProtocolException(message="Required field tag is unset!") + raise TProtocolException(message='Required field tag is unset!') return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1126,22 +795,8 @@ class VM(object): """ - def __init__( - self, - flav=None, - img=None, - status=None, - metadata=None, - project_id=None, - keyname=None, - openstack_id=None, - name=None, - created_at=None, - floating_ip=None, - fixed_ip=None, - diskspace=None, - volume_id=None, - ): + + def __init__(self, flav=None, img=None, status=None, metadata=None, project_id=None, keyname=None, openstack_id=None, name=None, created_at=None, floating_ip=None, fixed_ip=None, diskspace=None, volume_id=None,): self.flav = flav self.img = img self.status = status @@ -1157,11 +812,7 @@ def __init__( self.volume_id = volume_id def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -1183,11 +834,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.status = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.status = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: @@ -1195,81 +842,45 @@ def read(self, iprot): self.metadata = {} (_ktype15, _vtype16, _size14) = iprot.readMapBegin() for _i18 in range(_size14): - _key19 = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) - _val20 = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + _key19 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + _val20 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() self.metadata[_key19] = _val20 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.project_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.project_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.keyname = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.keyname = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: - self.openstack_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.openstack_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.name = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: - self.created_at = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.created_at = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: - self.floating_ip = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.floating_ip = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: - self.fixed_ip = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.fixed_ip = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: @@ -1279,11 +890,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: - self.volume_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.volume_id = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1293,128 +900,91 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("VM") + oprot.writeStructBegin('VM') if self.flav is not None: - oprot.writeFieldBegin("flav", TType.STRUCT, 1) + oprot.writeFieldBegin('flav', TType.STRUCT, 1) self.flav.write(oprot) oprot.writeFieldEnd() if self.img is not None: - oprot.writeFieldBegin("img", TType.STRUCT, 2) + oprot.writeFieldBegin('img', TType.STRUCT, 2) self.img.write(oprot) oprot.writeFieldEnd() if self.status is not None: - oprot.writeFieldBegin("status", TType.STRING, 3) - oprot.writeString( - self.status.encode("utf-8") if sys.version_info[0] == 2 else self.status - ) + oprot.writeFieldBegin('status', TType.STRING, 3) + oprot.writeString(self.status.encode('utf-8') if sys.version_info[0] == 2 else self.status) oprot.writeFieldEnd() if self.metadata is not None: - oprot.writeFieldBegin("metadata", TType.MAP, 4) + oprot.writeFieldBegin('metadata', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metadata)) for kiter21, viter22 in self.metadata.items(): - oprot.writeString( - kiter21.encode("utf-8") if sys.version_info[0] == 2 else kiter21 - ) - oprot.writeString( - viter22.encode("utf-8") if sys.version_info[0] == 2 else viter22 - ) + oprot.writeString(kiter21.encode('utf-8') if sys.version_info[0] == 2 else kiter21) + oprot.writeString(viter22.encode('utf-8') if sys.version_info[0] == 2 else viter22) oprot.writeMapEnd() oprot.writeFieldEnd() if self.project_id is not None: - oprot.writeFieldBegin("project_id", TType.STRING, 5) - oprot.writeString( - self.project_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.project_id - ) + oprot.writeFieldBegin('project_id', TType.STRING, 5) + oprot.writeString(self.project_id.encode('utf-8') if sys.version_info[0] == 2 else self.project_id) oprot.writeFieldEnd() if self.keyname is not None: - oprot.writeFieldBegin("keyname", TType.STRING, 6) - oprot.writeString( - self.keyname.encode("utf-8") - if sys.version_info[0] == 2 - else self.keyname - ) + oprot.writeFieldBegin('keyname', TType.STRING, 6) + oprot.writeString(self.keyname.encode('utf-8') if sys.version_info[0] == 2 else self.keyname) oprot.writeFieldEnd() if self.openstack_id is not None: - oprot.writeFieldBegin("openstack_id", TType.STRING, 7) - oprot.writeString( - self.openstack_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.openstack_id - ) + oprot.writeFieldBegin('openstack_id', TType.STRING, 7) + oprot.writeString(self.openstack_id.encode('utf-8') if sys.version_info[0] == 2 else self.openstack_id) oprot.writeFieldEnd() if self.name is not None: - oprot.writeFieldBegin("name", TType.STRING, 8) - oprot.writeString( - self.name.encode("utf-8") if sys.version_info[0] == 2 else self.name - ) + oprot.writeFieldBegin('name', TType.STRING, 8) + oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name) oprot.writeFieldEnd() if self.created_at is not None: - oprot.writeFieldBegin("created_at", TType.STRING, 9) - oprot.writeString( - self.created_at.encode("utf-8") - if sys.version_info[0] == 2 - else self.created_at - ) + oprot.writeFieldBegin('created_at', TType.STRING, 9) + oprot.writeString(self.created_at.encode('utf-8') if sys.version_info[0] == 2 else self.created_at) oprot.writeFieldEnd() if self.floating_ip is not None: - oprot.writeFieldBegin("floating_ip", TType.STRING, 10) - oprot.writeString( - self.floating_ip.encode("utf-8") - if sys.version_info[0] == 2 - else self.floating_ip - ) + oprot.writeFieldBegin('floating_ip', TType.STRING, 10) + oprot.writeString(self.floating_ip.encode('utf-8') if sys.version_info[0] == 2 else self.floating_ip) oprot.writeFieldEnd() if self.fixed_ip is not None: - oprot.writeFieldBegin("fixed_ip", TType.STRING, 11) - oprot.writeString( - self.fixed_ip.encode("utf-8") - if sys.version_info[0] == 2 - else self.fixed_ip - ) + oprot.writeFieldBegin('fixed_ip', TType.STRING, 11) + oprot.writeString(self.fixed_ip.encode('utf-8') if sys.version_info[0] == 2 else self.fixed_ip) oprot.writeFieldEnd() if self.diskspace is not None: - oprot.writeFieldBegin("diskspace", TType.I32, 12) + oprot.writeFieldBegin('diskspace', TType.I32, 12) oprot.writeI32(self.diskspace) oprot.writeFieldEnd() if self.volume_id is not None: - oprot.writeFieldBegin("volume_id", TType.STRING, 13) - oprot.writeString( - self.volume_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.volume_id - ) + oprot.writeFieldBegin('volume_id', TType.STRING, 13) + oprot.writeString(self.volume_id.encode('utf-8') if sys.version_info[0] == 2 else self.volume_id) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.flav is None: - raise TProtocolException(message="Required field flav is unset!") + raise TProtocolException(message='Required field flav is unset!') if self.img is None: - raise TProtocolException(message="Required field img is unset!") + raise TProtocolException(message='Required field img is unset!') if self.status is None: - raise TProtocolException(message="Required field status is unset!") + raise TProtocolException(message='Required field status is unset!') if self.keyname is None: - raise TProtocolException(message="Required field keyname is unset!") + raise TProtocolException(message='Required field keyname is unset!') if self.openstack_id is None: - raise TProtocolException(message="Required field openstack_id is unset!") + raise TProtocolException(message='Required field openstack_id is unset!') if self.name is None: - raise TProtocolException(message="Required field name is unset!") + raise TProtocolException(message='Required field name is unset!') if self.created_at is None: - raise TProtocolException(message="Required field created_at is unset!") + raise TProtocolException(message='Required field created_at is unset!') if self.fixed_ip is None: - raise TProtocolException(message="Required field fixed_ip is unset!") + raise TProtocolException(message='Required field fixed_ip is unset!') return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1432,22 +1002,14 @@ class ClusterInstance(object): """ - def __init__( - self, - type=None, - image=None, - count=None, - ): + + def __init__(self, type=None, image=None, count=None,): self.type = type self.image = image self.count = count def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -1457,20 +1019,12 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.type = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.type = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.image = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.image = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: @@ -1485,25 +1039,19 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("ClusterInstance") + oprot.writeStructBegin('ClusterInstance') if self.type is not None: - oprot.writeFieldBegin("type", TType.STRING, 1) - oprot.writeString( - self.type.encode("utf-8") if sys.version_info[0] == 2 else self.type - ) + oprot.writeFieldBegin('type', TType.STRING, 1) + oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type) oprot.writeFieldEnd() if self.image is not None: - oprot.writeFieldBegin("image", TType.STRING, 2) - oprot.writeString( - self.image.encode("utf-8") if sys.version_info[0] == 2 else self.image - ) + oprot.writeFieldBegin('image', TType.STRING, 2) + oprot.writeString(self.image.encode('utf-8') if sys.version_info[0] == 2 else self.image) oprot.writeFieldEnd() if self.count is not None: - oprot.writeFieldBegin("count", TType.I32, 3) + oprot.writeFieldBegin('count', TType.I32, 3) oprot.writeI32(self.count) oprot.writeFieldEnd() oprot.writeFieldStop() @@ -1511,14 +1059,15 @@ def write(self, oprot): def validate(self): if self.type is None: - raise TProtocolException(message="Required field type is unset!") + raise TProtocolException(message='Required field type is unset!') if self.image is None: - raise TProtocolException(message="Required field image is unset!") + raise TProtocolException(message='Required field image is unset!') return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1538,22 +1087,14 @@ class PlaybookResult(object): """ - def __init__( - self, - status=None, - stdout=None, - stderr=None, - ): + + def __init__(self, status=None, stdout=None, stderr=None,): self.status = status self.stdout = stdout self.stderr = stderr def read(self, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and self.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return iprot.readStructBegin() @@ -1568,20 +1109,12 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.stdout = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.stdout = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.stderr = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + self.stderr = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1591,42 +1124,37 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("PlaybookResult") + oprot.writeStructBegin('PlaybookResult') if self.status is not None: - oprot.writeFieldBegin("status", TType.I32, 1) + oprot.writeFieldBegin('status', TType.I32, 1) oprot.writeI32(self.status) oprot.writeFieldEnd() if self.stdout is not None: - oprot.writeFieldBegin("stdout", TType.STRING, 2) - oprot.writeString( - self.stdout.encode("utf-8") if sys.version_info[0] == 2 else self.stdout - ) + oprot.writeFieldBegin('stdout', TType.STRING, 2) + oprot.writeString(self.stdout.encode('utf-8') if sys.version_info[0] == 2 else self.stdout) oprot.writeFieldEnd() if self.stderr is not None: - oprot.writeFieldBegin("stderr", TType.STRING, 3) - oprot.writeString( - self.stderr.encode("utf-8") if sys.version_info[0] == 2 else self.stderr - ) + oprot.writeFieldBegin('stderr', TType.STRING, 3) + oprot.writeString(self.stderr.encode('utf-8') if sys.version_info[0] == 2 else self.stderr) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): if self.status is None: - raise TProtocolException(message="Required field status is unset!") + raise TProtocolException(message='Required field status is unset!') if self.stdout is None: - raise TProtocolException(message="Required field stdout is unset!") + raise TProtocolException(message='Required field stdout is unset!') if self.stderr is None: - raise TProtocolException(message="Required field stderr is unset!") + raise TProtocolException(message='Required field stderr is unset!') return def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1642,11 +1170,9 @@ class otherException(TException): """ - def __init__( - self, - Reason=None, - ): - super(otherException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(otherException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -1655,15 +1181,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -1673,11 +1195,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1690,16 +1208,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("otherException") + oprot.writeStructBegin('otherException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1711,8 +1225,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1728,11 +1243,9 @@ class ressourceException(TException): """ - def __init__( - self, - Reason=None, - ): - super(ressourceException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(ressourceException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -1741,15 +1254,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -1759,11 +1268,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1776,16 +1281,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("ressourceException") + oprot.writeStructBegin('ressourceException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1797,8 +1298,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1814,11 +1316,9 @@ class nameException(TException): """ - def __init__( - self, - Reason=None, - ): - super(nameException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(nameException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -1827,15 +1327,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -1845,11 +1341,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1862,16 +1354,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("nameException") + oprot.writeStructBegin('nameException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1883,8 +1371,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1900,11 +1389,9 @@ class serverNotFoundException(TException): """ - def __init__( - self, - Reason=None, - ): - super(serverNotFoundException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(serverNotFoundException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -1913,15 +1400,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -1931,11 +1414,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1948,16 +1427,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("serverNotFoundException") + oprot.writeStructBegin('serverNotFoundException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1969,8 +1444,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -1986,11 +1462,9 @@ class networkNotFoundException(TException): """ - def __init__( - self, - Reason=None, - ): - super(networkNotFoundException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(networkNotFoundException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -1999,15 +1473,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -2017,11 +1487,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2034,16 +1500,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("networkNotFoundException") + oprot.writeStructBegin('networkNotFoundException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2055,8 +1517,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -2072,11 +1535,9 @@ class imageNotFoundException(TException): """ - def __init__( - self, - Reason=None, - ): - super(imageNotFoundException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(imageNotFoundException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -2085,15 +1546,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -2103,11 +1560,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2120,16 +1573,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("imageNotFoundException") + oprot.writeStructBegin('imageNotFoundException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2141,8 +1590,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -2158,11 +1608,9 @@ class flavorNotFoundException(TException): """ - def __init__( - self, - Reason=None, - ): - super(flavorNotFoundException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(flavorNotFoundException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -2171,15 +1619,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -2189,11 +1633,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2206,16 +1646,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("flavorNotFoundException") + oprot.writeStructBegin('flavorNotFoundException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2227,8 +1663,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -2246,11 +1683,9 @@ class authenticationException(TException): """ - def __init__( - self, - Reason=None, - ): - super(authenticationException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(authenticationException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -2259,15 +1694,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -2277,11 +1708,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2294,16 +1721,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("authenticationException") + oprot.writeStructBegin('authenticationException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2315,8 +1738,9 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ @@ -2334,11 +1758,9 @@ class conflictException(TException): """ - def __init__( - self, - Reason=None, - ): - super(conflictException, self).__setattr__("Reason", Reason) + + def __init__(self, Reason=None,): + super(conflictException, self).__setattr__('Reason', Reason) def __setattr__(self, *args): raise TypeError("can't modify immutable instance") @@ -2347,15 +1769,11 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.Reason,)) + return hash(self.__class__) ^ hash((self.Reason, )) @classmethod def read(cls, iprot): - if ( - iprot._fast_decode is not None - and isinstance(iprot.trans, TTransport.CReadableTransport) - and cls.thrift_spec is not None - ): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() Reason = None @@ -2365,11 +1783,7 @@ def read(cls, iprot): break if fid == 1: if ftype == TType.STRING: - Reason = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) + Reason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -2382,16 +1796,12 @@ def read(cls, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write( - oprot._fast_encode(self, [self.__class__, self.thrift_spec]) - ) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin("conflictException") + oprot.writeStructBegin('conflictException') if self.Reason is not None: - oprot.writeFieldBegin("Reason", TType.STRING, 1) - oprot.writeString( - self.Reason.encode("utf-8") if sys.version_info[0] == 2 else self.Reason - ) + oprot.writeFieldBegin('Reason', TType.STRING, 1) + oprot.writeString(self.Reason.encode('utf-8') if sys.version_info[0] == 2 else self.Reason) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2403,587 +1813,154 @@ def __str__(self): return repr(self) def __repr__(self): - L = ["%s=%r" % (key, value) for key, value in self.__dict__.items()] - return "%s(%s)" % (self.__class__.__name__, ", ".join(L)) + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ def __ne__(self, other): return not (self == other) - - all_structs.append(Backend) Backend.thrift_spec = ( None, # 0 - ( - 1, - TType.I64, - "id", - None, - None, - ), # 1 - ( - 2, - TType.STRING, - "owner", - "UTF8", - None, - ), # 2 - ( - 3, - TType.STRING, - "location_url", - "UTF8", - None, - ), # 3 - ( - 4, - TType.STRING, - "template", - "UTF8", - None, - ), # 4 - ( - 5, - TType.STRING, - "template_version", - "UTF8", - None, - ), # 5 + (1, TType.I64, 'id', None, None, ), # 1 + (2, TType.STRING, 'owner', 'UTF8', None, ), # 2 + (3, TType.STRING, 'location_url', 'UTF8', None, ), # 3 + (4, TType.STRING, 'template', 'UTF8', None, ), # 4 + (5, TType.STRING, 'template_version', 'UTF8', None, ), # 5 ) all_structs.append(ClusterInfo) ClusterInfo.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "launch_date", - "UTF8", - None, - ), # 1 - ( - 2, - TType.STRING, - "group_id", - "UTF8", - None, - ), # 2 - ( - 3, - TType.STRING, - "network_id", - "UTF8", - None, - ), # 3 - ( - 4, - TType.STRING, - "public_ip", - "UTF8", - None, - ), # 4 - ( - 5, - TType.STRING, - "subnet_id", - "UTF8", - None, - ), # 5 - ( - 6, - TType.STRING, - "user", - "UTF8", - None, - ), # 6 - ( - 7, - TType.I32, - "inst_counter", - None, - None, - ), # 7 - ( - 8, - TType.STRING, - "cluster_id", - "UTF8", - None, - ), # 8 - ( - 9, - TType.STRING, - "key_name", - "UTF8", - None, - ), # 9 - ( - 10, - TType.STRING, - "pub_key", - "UTF8", - None, - ), # 10 + (1, TType.STRING, 'launch_date', 'UTF8', None, ), # 1 + (2, TType.STRING, 'group_id', 'UTF8', None, ), # 2 + (3, TType.STRING, 'network_id', 'UTF8', None, ), # 3 + (4, TType.STRING, 'public_ip', 'UTF8', None, ), # 4 + (5, TType.STRING, 'subnet_id', 'UTF8', None, ), # 5 + (6, TType.STRING, 'user', 'UTF8', None, ), # 6 + (7, TType.I32, 'inst_counter', None, None, ), # 7 + (8, TType.STRING, 'cluster_id', 'UTF8', None, ), # 8 + (9, TType.STRING, 'key_name', 'UTF8', None, ), # 9 + (10, TType.STRING, 'pub_key', 'UTF8', None, ), # 10 ) all_structs.append(Volume) Volume.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "id", - "UTF8", - None, - ), # 1 - ( - 2, - TType.STRING, - "name", - "UTF8", - None, - ), # 2 - ( - 3, - TType.STRING, - "description", - "UTF8", - None, - ), # 3 - ( - 4, - TType.STRING, - "status", - "UTF8", - None, - ), # 4 - ( - 5, - TType.STRING, - "created_at", - "UTF8", - None, - ), # 5 - ( - 6, - TType.STRING, - "device", - "UTF8", - None, - ), # 6 - ( - 7, - TType.I32, - "size", - None, - None, - ), # 7 - ( - 8, - TType.STRING, - "server_id", - "UTF8", - None, - ), # 8 + (1, TType.STRING, 'id', 'UTF8', None, ), # 1 + (2, TType.STRING, 'name', 'UTF8', None, ), # 2 + (3, TType.STRING, 'description', 'UTF8', None, ), # 3 + (4, TType.STRING, 'status', 'UTF8', None, ), # 4 + (5, TType.STRING, 'created_at', 'UTF8', None, ), # 5 + (6, TType.STRING, 'device', 'UTF8', None, ), # 6 + (7, TType.I32, 'size', None, None, ), # 7 + (8, TType.STRING, 'server_id', 'UTF8', None, ), # 8 ) all_structs.append(Flavor) Flavor.thrift_spec = ( None, # 0 - ( - 1, - TType.I32, - "vcpus", - None, - None, - ), # 1 - ( - 2, - TType.I32, - "ram", - None, - None, - ), # 2 - ( - 3, - TType.I32, - "disk", - None, - None, - ), # 3 - ( - 4, - TType.STRING, - "name", - "UTF8", - None, - ), # 4 - ( - 5, - TType.STRING, - "openstack_id", - "UTF8", - None, - ), # 5 - ( - 6, - TType.STRING, - "description", - "UTF8", - None, - ), # 6 - ( - 7, - TType.LIST, - "tags", - (TType.STRING, "UTF8", False), - None, - ), # 7 - ( - 8, - TType.I32, - "ephemeral_disk", - None, - None, - ), # 8 + (1, TType.I32, 'vcpus', None, None, ), # 1 + (2, TType.I32, 'ram', None, None, ), # 2 + (3, TType.I32, 'disk', None, None, ), # 3 + (4, TType.STRING, 'name', 'UTF8', None, ), # 4 + (5, TType.STRING, 'openstack_id', 'UTF8', None, ), # 5 + (6, TType.STRING, 'description', 'UTF8', None, ), # 6 + (7, TType.LIST, 'tags', (TType.STRING, 'UTF8', False), None, ), # 7 + (8, TType.I32, 'ephemeral_disk', None, None, ), # 8 ) all_structs.append(Image) Image.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "name", - "UTF8", - None, - ), # 1 - ( - 2, - TType.I32, - "min_disk", - None, - None, - ), # 2 - ( - 3, - TType.I32, - "min_ram", - None, - None, - ), # 3 - ( - 4, - TType.STRING, - "status", - "UTF8", - None, - ), # 4 - ( - 5, - TType.STRING, - "created_at", - "UTF8", - None, - ), # 5 - ( - 6, - TType.STRING, - "updated_at", - "UTF8", - None, - ), # 6 - ( - 7, - TType.STRING, - "openstack_id", - "UTF8", - None, - ), # 7 - ( - 8, - TType.STRING, - "description", - "UTF8", - None, - ), # 8 - ( - 9, - TType.LIST, - "tag", - (TType.STRING, "UTF8", False), - None, - ), # 9 - ( - 10, - TType.BOOL, - "is_snapshot", - None, - None, - ), # 10 - ( - 11, - TType.STRING, - "os_version", - "UTF8", - None, - ), # 11 - ( - 12, - TType.STRING, - "os_distro", - "UTF8", - None, - ), # 12 - ( - 13, - TType.STRING, - "slurm_version", - "UTF8", - None, - ), # 13 + (1, TType.STRING, 'name', 'UTF8', None, ), # 1 + (2, TType.I32, 'min_disk', None, None, ), # 2 + (3, TType.I32, 'min_ram', None, None, ), # 3 + (4, TType.STRING, 'status', 'UTF8', None, ), # 4 + (5, TType.STRING, 'created_at', 'UTF8', None, ), # 5 + (6, TType.STRING, 'updated_at', 'UTF8', None, ), # 6 + (7, TType.STRING, 'openstack_id', 'UTF8', None, ), # 7 + (8, TType.STRING, 'description', 'UTF8', None, ), # 8 + (9, TType.LIST, 'tag', (TType.STRING, 'UTF8', False), None, ), # 9 + (10, TType.BOOL, 'is_snapshot', None, None, ), # 10 + (11, TType.STRING, 'os_version', 'UTF8', None, ), # 11 + (12, TType.STRING, 'os_distro', 'UTF8', None, ), # 12 + (13, TType.STRING, 'slurm_version', 'UTF8', None, ), # 13 ) all_structs.append(VM) VM.thrift_spec = ( None, # 0 - ( - 1, - TType.STRUCT, - "flav", - [Flavor, None], - None, - ), # 1 - ( - 2, - TType.STRUCT, - "img", - [Image, None], - None, - ), # 2 - ( - 3, - TType.STRING, - "status", - "UTF8", - None, - ), # 3 - ( - 4, - TType.MAP, - "metadata", - (TType.STRING, "UTF8", TType.STRING, "UTF8", False), - None, - ), # 4 - ( - 5, - TType.STRING, - "project_id", - "UTF8", - None, - ), # 5 - ( - 6, - TType.STRING, - "keyname", - "UTF8", - None, - ), # 6 - ( - 7, - TType.STRING, - "openstack_id", - "UTF8", - None, - ), # 7 - ( - 8, - TType.STRING, - "name", - "UTF8", - None, - ), # 8 - ( - 9, - TType.STRING, - "created_at", - "UTF8", - None, - ), # 9 - ( - 10, - TType.STRING, - "floating_ip", - "UTF8", - None, - ), # 10 - ( - 11, - TType.STRING, - "fixed_ip", - "UTF8", - None, - ), # 11 - ( - 12, - TType.I32, - "diskspace", - None, - None, - ), # 12 - ( - 13, - TType.STRING, - "volume_id", - "UTF8", - None, - ), # 13 + (1, TType.STRUCT, 'flav', [Flavor, None], None, ), # 1 + (2, TType.STRUCT, 'img', [Image, None], None, ), # 2 + (3, TType.STRING, 'status', 'UTF8', None, ), # 3 + (4, TType.MAP, 'metadata', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 + (5, TType.STRING, 'project_id', 'UTF8', None, ), # 5 + (6, TType.STRING, 'keyname', 'UTF8', None, ), # 6 + (7, TType.STRING, 'openstack_id', 'UTF8', None, ), # 7 + (8, TType.STRING, 'name', 'UTF8', None, ), # 8 + (9, TType.STRING, 'created_at', 'UTF8', None, ), # 9 + (10, TType.STRING, 'floating_ip', 'UTF8', None, ), # 10 + (11, TType.STRING, 'fixed_ip', 'UTF8', None, ), # 11 + (12, TType.I32, 'diskspace', None, None, ), # 12 + (13, TType.STRING, 'volume_id', 'UTF8', None, ), # 13 ) all_structs.append(ClusterInstance) ClusterInstance.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "type", - "UTF8", - None, - ), # 1 - ( - 2, - TType.STRING, - "image", - "UTF8", - None, - ), # 2 - ( - 3, - TType.I32, - "count", - None, - None, - ), # 3 + (1, TType.STRING, 'type', 'UTF8', None, ), # 1 + (2, TType.STRING, 'image', 'UTF8', None, ), # 2 + (3, TType.I32, 'count', None, None, ), # 3 ) all_structs.append(PlaybookResult) PlaybookResult.thrift_spec = ( None, # 0 - ( - 1, - TType.I32, - "status", - None, - None, - ), # 1 - ( - 2, - TType.STRING, - "stdout", - "UTF8", - None, - ), # 2 - ( - 3, - TType.STRING, - "stderr", - "UTF8", - None, - ), # 3 + (1, TType.I32, 'status', None, None, ), # 1 + (2, TType.STRING, 'stdout', 'UTF8', None, ), # 2 + (3, TType.STRING, 'stderr', 'UTF8', None, ), # 3 ) all_structs.append(otherException) otherException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(ressourceException) ressourceException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(nameException) nameException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(serverNotFoundException) serverNotFoundException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(networkNotFoundException) networkNotFoundException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(imageNotFoundException) imageNotFoundException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(flavorNotFoundException) flavorNotFoundException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(authenticationException) authenticationException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) all_structs.append(conflictException) conflictException.thrift_spec = ( None, # 0 - ( - 1, - TType.STRING, - "Reason", - "UTF8", - None, - ), # 1 + (1, TType.STRING, 'Reason', 'UTF8', None, ), # 1 ) fix_spec(all_structs) del all_structs