Fix the online status in OpsWorks
When an instance is running, OpsWorks reports its status as "online" [1], while EC2 reports it as "running". Until now, moto copied the EC2 instance's status as is. This commit introduces the converts the running status to online when returned by OpsWorks. [1]: https://docs.aws.amazon.com/cli/latest/reference/opsworks/describe-instances.html
This commit is contained in:
parent
df1e0d80c5
commit
4abd88f95c
2 changed files with 9 additions and 0 deletions
|
|
@ -125,6 +125,9 @@ class OpsworkInstance(BaseModel):
|
|||
def status(self):
|
||||
if self.instance is None:
|
||||
return "stopped"
|
||||
# OpsWorks reports the "running" state as "online"
|
||||
elif self.instance._state.name == "running":
|
||||
return "online"
|
||||
return self.instance._state.name
|
||||
|
||||
def to_dict(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue