示例#1
0
文件: sunny.py 项目: ooici/ape
 def start_nodes(self):
     """ invoke cloudinitd to start nodes """
     if self.state!=CONFIGURED:
         raise ApeException('cannot start nodes when troop state is ' + self.state)
     chdir(self.target_directory)
     try:
         cloudinitd(argv=['boot', 'troop-launch.conf', '-n', self.launch_name])
         self.state=RUNNING
     except:
         self.state=FAILED
示例#2
0
文件: sunny.py 项目: ooici/ape
 def stop_nodes(self):
     """ invoke cloudinitd to stop all nodes """
     if self.state!=RUNNING and self.state!=FAILED:
         raise ApeException('cannot stop nodes when troop state is ' + self.state)
     chdir(self.target_directory)
     cloudinitd(argv=['terminate', self.launch_name])