Example #1
0
 def _osmosFromNetwork(self, destination):
     self._debugPort = debugthread.DebugThread()
     if self._args.inauguratorServerAMQPURL:
         self._talkToServer.checkIn()
     try:
         osmos = osmose.Osmose(
             destination=destination,
             objectStores=self._args.inauguratorOsmosisObjectStores,
             withLocalObjectStore=self._args.
             inauguratorWithLocalObjectStore,
             noChainTouch=self._args.inauguratorNoChainTouch,
             ignoreDirs=self._args.inauguratorIgnoreDirs +
             [consts.INAUGURATOR_LOG_FILE_NAME],
             talkToServer=self._talkToServer)
         if self._args.inauguratorServerAMQPURL:
             self._label = self._talkToServer.label()
         else:
             self._label = self._args.inauguratorNetworkLabel
         osmos.tellLabel(self._label)
         osmos.wait()
     except Exception as e:
         if self._debugPort is not None and self._debugPort.wasRebootCalled(
         ):
             logging.info("Waiting to be reboot (from outside)...")
             blockForever = threading.Event()
             blockForever.wait()
         else:
             try:
                 self._talkToServer.failed(message=str(e))
             except:
                 pass
         raise e
Example #2
0
 def _osmosFromLocalObjectStore(self, destination):
     osmos = osmose.Osmose(
         destination,
         objectStores=None,
         withLocalObjectStore=self._args.inauguratorWithLocalObjectStore,
         ignoreDirs=self._args.inauguratorIgnoreDirs,
         talkToServer=self._talkToServer)
     self._label = self._args.inauguratorNetworkLabel
     osmos.tellLabel(self._label)
     osmos.wait()
Example #3
0
 def _osmosFromLocalObjectStore(self, destination):
     osmos = osmose.Osmose(
         destination,
         objectStores=None,
         withLocalObjectStore=self._args.inauguratorWithLocalObjectStore,
         noChainTouch=self._args.inauguratorNoChainTouch,
         ignoreDirs=self._args.inauguratorIgnoreDirs +
         [consts.INAUGURATOR_LOG_FILE_NAME],
         talkToServer=self._talkToServer)
     self._label = self._args.inauguratorNetworkLabel
     osmos.tellLabel(self._label)
     osmos.wait()
Example #4
0
 def _osmosFromCDROM(self, destination):
     cdromInstance = cdrom.Cdrom()
     with cdromInstance.mount() as source:
         osmos = osmose.Osmose(destination,
                               objectStores=source + "/osmosisobjectstore",
                               withLocalObjectStore=self._args.
                               inauguratorWithLocalObjectStore,
                               ignoreDirs=self._args.inauguratorIgnoreDirs,
                               talkToServer=self._talkToServer)
         with open("%s/inaugurate_label.txt" % source) as f:
             self._label = f.read().strip()
         osmos.tellLabel(
             self._label)  # This must stay under the mount 'with' statement
         osmos.wait()
Example #5
0
 def _osmosFromDOK(self, destination):
     dok = diskonkey.DiskOnKey()
     with dok.mount() as source:
         osmos = osmose.Osmose(destination,
                               objectStores=source + "/osmosisobjectstore",
                               withLocalObjectStore=self._args.
                               inauguratorWithLocalObjectStore,
                               ignoreDirs=self._args.inauguratorIgnoreDirs,
                               talkToServer=self._talkToServer)
         with open("%s/inaugurate_label.txt" % source) as f:
             self._label = f.read().strip()
         osmos.tellLabel(
             self._label
         )  # This must stay under the dok mount 'with' statement
         osmos.wait()
Example #6
0
 def _osmosFromNetwork(self, destination):
     network.Network(macAddress=self._args.inauguratorUseNICWithMAC,
                     ipAddress=self._args.inauguratorIPAddress,
                     netmask=self._args.inauguratorNetmask,
                     gateway=self._args.inauguratorGateway)
     if self._args.inauguratorServerAMQPURL:
         self._talkToServer = talktoserver.TalkToServer(
             amqpURL=self._args.inauguratorServerAMQPURL,
             myID=self._args.inauguratorMyIDForServer)
         self._talkToServer.checkIn()
     osmos = osmose.Osmose(
         destination=destination,
         objectStores=self._args.inauguratorOsmosisObjectStores,
         withLocalObjectStore=self._args.inauguratorWithLocalObjectStore,
         ignoreDirs=self._args.inauguratorIgnoreDirs,
         talkToServer=self._talkToServer)
     if self._args.inauguratorServerAMQPURL:
         self._label = self._talkToServer.label()
     else:
         self._label = self._args.inauguratorNetworkLabel
     osmos.tellLabel(self._label)
     osmos.wait()