Ejemplo n.º 1
0
 def copy_of_datastream(self, new_filename=None):
     prefixed_name = common.get_prefixed_name("ds_modified")
     old_filename = self.datastream
     if not new_filename:
         descriptor, new_filename = tempfile.mkstemp(prefix=prefixed_name,
                                                     dir="/tmp")
     os.close(descriptor)
     shutil.copy(old_filename, new_filename)
     self.datastream = new_filename
     yield new_filename
     self.datastream = old_filename
     os.unlink(new_filename)
Ejemplo n.º 2
0
 def _save_state(self, state_name):
     prefixed_state_name = common.get_prefixed_name(state_name)
     state = self._create_new_image(self.current_container,
                                    prefixed_state_name)
     return state
Ejemplo n.º 3
0
 def _save_state(self, state_name):
     prefixed_state_name = common.get_prefixed_name(state_name)
     state = self.snapshot_stack.create(prefixed_state_name)
     return state
Ejemplo n.º 4
0
 def save_state(self, state_name):
     self.running_state_base = common.get_prefixed_name(state_name)
     running_state = self.running_state
     return self._save_state(state_name)
Ejemplo n.º 5
0
 def __init__(self, environment, name):
     self.name = common.get_prefixed_name(name)
     self.environment = environment
     self.initial_running_state = True