コード例 #1
0
ファイル: basemachines.py プロジェクト: joelsefus/paella
 def _set_machine_install(self, machine, install=True):
     settings = self.request.registry.settings
     filename = pxeconfig_filename(machine.uuid)
     if install:
         make_pxeconfig(machine, settings)
         # FIXME: this makes sure that the key in the database
         # that the machine will be preseeded with is accepted
         # by the salt-master.
         self.mgr.accept_machine(machine, force=True)
         if not self.has_pxeconfig(machine, filename=filename):
             raise RuntimeError, "%s doesn't exist." % filename
     else:
         remove_pxeconfig(machine.uuid)
         if self.has_pxeconfig(machine, filename=filename):
             raise RuntimeError, "%s still exists." % filename
コード例 #2
0
 def _set_machine_install(self, machine, install=True):
     settings = self.request.registry.settings
     filename = pxeconfig_filename(machine.uuid)
     if install:
         make_pxeconfig(machine, settings)
         # FIXME: this makes sure that the key in the database
         # that the machine will be preseeded with is accepted
         # by the salt-master.
         self.mgr.accept_machine(machine, force=True)
         if not self.has_pxeconfig(machine, filename=filename):
             raise RuntimeError, "%s doesn't exist." % filename
     else:
         remove_pxeconfig(machine.uuid)
         if self.has_pxeconfig(machine, filename=filename):
             raise RuntimeError, "%s still exists." % filename
コード例 #3
0
ファイル: basemachines.py プロジェクト: joelsefus/paella
 def has_pxeconfig(self, machine, filename=None):
     if filename is None:
         filename = pxeconfig_filename(machine.uuid)
     return os.path.isfile(filename)
コード例 #4
0
 def has_pxeconfig(self, machine, filename=None):
     if filename is None:
         filename = pxeconfig_filename(machine.uuid)
     return os.path.isfile(filename)