EMR: Rename get_cluster to describe_cluster (#4504)

This commit is contained in:
Anay Nayak 2021-10-30 16:38:03 +05:30 committed by GitHub
parent e1298e334b
commit 13f985115b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 9 deletions

3
.gitignore vendored
View File

@ -24,4 +24,5 @@ tests/file.tmp
*.tmp
.venv/
htmlcov/
.~c9_*
.~c9_*
.coverage*

View File

@ -1858,7 +1858,7 @@
## emr
<details>
<summary>40% implemented</summary>
<summary>42% implemented</summary>
- [ ] add_instance_fleet
- [X] add_instance_groups
@ -1871,7 +1871,7 @@
- [X] delete_security_configuration
- [ ] delete_studio
- [ ] delete_studio_session_mapping
- [ ] describe_cluster
- [X] describe_cluster
- [X] describe_job_flows
- [ ] describe_notebook_execution
- [ ] describe_release_label

View File

@ -414,7 +414,7 @@ class ElasticMapReduceBackend(BaseBackend):
return ec2_backends[self.region_name]
def add_applications(self, cluster_id, applications):
cluster = self.get_cluster(cluster_id)
cluster = self.describe_cluster(cluster_id)
cluster.add_applications(applications)
def add_instance_groups(self, cluster_id, instance_groups):
@ -444,7 +444,7 @@ class ElasticMapReduceBackend(BaseBackend):
return steps
def add_tags(self, cluster_id, tags):
cluster = self.get_cluster(cluster_id)
cluster = self.describe_cluster(cluster_id)
cluster.add_tags(tags)
def describe_job_flows(
@ -479,7 +479,7 @@ class ElasticMapReduceBackend(BaseBackend):
if step.id == step_id:
return step
def get_cluster(self, cluster_id):
def describe_cluster(self, cluster_id):
if cluster_id in self.clusters:
return self.clusters[cluster_id]
raise EmrError("ResourceNotFoundException", "", "error_json")
@ -578,7 +578,7 @@ class ElasticMapReduceBackend(BaseBackend):
return result_groups
def remove_tags(self, cluster_id, tag_keys):
cluster = self.get_cluster(cluster_id)
cluster = self.describe_cluster(cluster_id)
cluster.remove_tags(tag_keys)
def _manage_security_groups(

View File

@ -128,7 +128,7 @@ class ElasticMapReduceResponse(BaseResponse):
@generate_boto3_response("DescribeCluster")
def describe_cluster(self):
cluster_id = self._get_param("ClusterId")
cluster = self.backend.get_cluster(cluster_id)
cluster = self.backend.describe_cluster(cluster_id)
template = self.response_template(DESCRIBE_CLUSTER_TEMPLATE)
return template.render(cluster=cluster)
@ -528,7 +528,7 @@ class ElasticMapReduceResponse(BaseResponse):
@generate_boto3_response("PutAutoScalingPolicy")
def put_auto_scaling_policy(self):
cluster_id = self._get_param("ClusterId")
cluster = self.backend.get_cluster(cluster_id)
cluster = self.backend.describe_cluster(cluster_id)
instance_group_id = self._get_param("InstanceGroupId")
auto_scaling_policy = self._get_param("AutoScalingPolicy")
instance_group = self.backend.put_auto_scaling_policy(