Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
excelwang committed Jul 9, 2019
1 parent 9fc96f5 commit 908cfa6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pk1/clouds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def perform(self=self):
output=ins.start()
elif self.operation==INSTANCE_OPERATION.reboot.value:
output=ins.reboot()
elif self.operation in [INSTANCE_OPERATION.poweroff.value, INSTANCE_OPERATION.stop.value]:
elif self.operation in [INSTANCE_OPERATION.poweroff.value, INSTANCE_OPERATION.shutdown.value]:
output=ins.stop()
if self.is_boot:
utils.SSH(self.target.ipv4,
Expand Down
4 changes: 2 additions & 2 deletions pk1/clouds/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.dispatch import receiver
from django.db.models.signals import pre_save, post_save, pre_delete, post_delete
from .models import Cloud, Image, Instance, Volume, Mount, InstanceOperation, Group, GroupOperation
from .models import INSTANCE_OPERATION, OPERATION_STATUS, VOLUME_STATUS
from .models import INSTANCE_STATUS, INSTANCE_OPERATION, OPERATION_STATUS, VOLUME_STATUS
from . import utils

#TODO use singleton
Expand Down Expand Up @@ -235,7 +235,7 @@ def materialize_group(sender,instance,**kwargs):
for ins in group.instances.all():
ins.remedy(manual=False)
group.remedy(utils.remedy_script_hosts_add(group.hosts),manual=False)
if group.status in [models.INSTANCE_STATUS.poweroff, models.INSTANCE_STATUS.shutdown]:
if group.status in [INSTANCE_STATUS.poweroff, INSTANCE_STATUS.shutdown]:
GroupOperation(
operation=INSTANCE_OPERATION.start.value,
target=group,
Expand Down

0 comments on commit 908cfa6

Please sign in to comment.