Esempio n. 1
0
 def __init__(self, index=None, account_libmesos="libmesos",
                                account=None,
                                dockercfg=None):
     _Struct.__init__(self, index=index,
                            account_libmesos=account_libmesos,
                            account=account,
                            dockercfg=dockercfg)
Esempio n. 2
0
 def __init__(self, root, docker_id=None, mesos_id=None, executor_id=None):
     _Struct.__init__(self,
                      root=os.path.abspath(root),
                      docker_id=docker_id,
                      mesos_id=mesos_id,
                      executor_id=executor_id,
                      timestamp=None)
Esempio n. 3
0
 def __init__(self, data):
     kvs = [line.strip().split(" ") for line in data.strip().split("\n")]
     res = {}
     for kvs in kvs:
         if len(kvs) != 2: continue  # Silently skip lines that aren't pairs
         k, v = kvs
         res[k] = v
     _Struct.__init__(self, **res)
Esempio n. 4
0
 def __init__(self, data):
     kvs = [ line.strip().split(" ") for line in data.strip().split("\n") ]
     res = {}
     for kvs in kvs:
         if len(kvs) != 2: continue  # Silently skip lines that aren't pairs
         k, v = kvs
         res[k] = v
     _Struct.__init__(self, **res)
Esempio n. 5
0
 def __init__(self,
              index=None,
              account_libmesos="libmesos",
              account=None,
              dockercfg=None):
     _Struct.__init__(self,
                      index=index,
                      account_libmesos=account_libmesos,
                      account=account,
                      dockercfg=dockercfg)
Esempio n. 6
0
    def __init__(self, path, flags, seconds=default_timeout):
        """Construct a lockable file handle. Handles are recycled.

        If seconds is 0, LOCK_NB will be set. If LOCK_NB is set, seconds will
        be set to 0. If seconds is None, there will be no timeout; but flags
        will not be adjusted in any way.
        """
        full = os.path.abspath(path)
        flags, seconds = nb_seconds(flags, seconds)
        if full not in locks:
            _Struct.__init__(self, path=full, handle=None, fd=None, flags=flags, seconds=seconds)
            locks[self.path] = self
Esempio n. 7
0
File: cmd.py Progetto: burke/deimos
 def __init__(self, log=None, data=False, in_sh=True,
                    close_stdin=True, log_stderr=True,
                    start_level=logging.DEBUG,
                    success_level=logging.DEBUG,
                    error_level=logging.WARNING):
     _Struct.__init__(self, log   = log if log else deimos.logger.logger(2),
                            data  = data,
                            in_sh = in_sh,
                            close_stdin   = close_stdin,
                            log_stderr    = log_stderr,
                            start_level   = start_level,
                            success_level = success_level,
                            error_level   = error_level)
Esempio n. 8
0
 def __init__(self, log=None, data=False, in_sh=True,
                    close_stdin=True, log_stderr=True,
                    start_level=logging.DEBUG,
                    success_level=logging.DEBUG,
                    error_level=logging.WARNING):
     _Struct.__init__(self, log   = log if log else deimos.logger.logger(2),
                            data  = data,
                            in_sh = in_sh,
                            close_stdin   = close_stdin,
                            log_stderr    = log_stderr,
                            start_level   = start_level,
                            success_level = success_level,
                            error_level   = error_level)
Esempio n. 9
0
 def __init__(self, workdir="/tmp/mesos-sandbox",
                    state_root="/tmp/deimos",
                    shared_dir="fs",
                    optimistic_unpack=True,
                    container_settings=deimos.config.Containers(),
                    index_settings=deimos.config.DockerIndex()):
     _Struct.__init__(self, workdir=workdir,
                            state_root=state_root,
                            shared_dir=shared_dir,
                            optimistic_unpack=optimistic_unpack,
                            container_settings=container_settings,
                            index_settings=index_settings,
                            runner=None,
                            state=None)
Esempio n. 10
0
 def __init__(self, proto):
     underlying = LaunchProto(proto)
     self._underlying = underlying
     _Struct.__init__(self, executor_id=underlying.executor_id(),
                            container_id=underlying.container_id(),
                            container=underlying.container(),
                            argv=underlying.argv(),
                            env=underlying.env(),
                            uris=underlying.uris(),
                            ports=underlying.ports(),
                            cpu_and_mem=underlying.cpu_and_mem(),
                            directory=underlying.directory(),
                            user=underlying.user(),
                            needs_observer=underlying.needs_observer())
Esempio n. 11
0
 def __init__(self, proto):
     underlying = LaunchProto(proto)
     self._underlying = underlying
     _Struct.__init__(self,
                      executor_id=underlying.executor_id(),
                      container_id=underlying.container_id(),
                      container=underlying.container(),
                      argv=underlying.argv(),
                      env=underlying.env(),
                      uris=underlying.uris(),
                      ports=underlying.ports(),
                      cpu_and_mem=underlying.cpu_and_mem(),
                      directory=underlying.directory(),
                      user=underlying.user(),
                      needs_observer=underlying.needs_observer())
Esempio n. 12
0
 def __init__(self,
              workdir="/tmp/mesos-sandbox",
              state_root="/tmp/deimos",
              shared_dir="fs",
              optimistic_unpack=True,
              container_settings=deimos.config.Containers(),
              index_settings=deimos.config.DockerIndex()):
     _Struct.__init__(self,
                      workdir=workdir,
                      state_root=state_root,
                      shared_dir=shared_dir,
                      optimistic_unpack=optimistic_unpack,
                      container_settings=container_settings,
                      index_settings=index_settings,
                      runner=None,
                      state=None)
Esempio n. 13
0
    def __init__(self, path, flags, seconds=default_timeout):
        """Construct a lockable file handle. Handles are recycled.

        If seconds is 0, LOCK_NB will be set. If LOCK_NB is set, seconds will
        be set to 0. If seconds is None, there will be no timeout; but flags
        will not be adjusted in any way.
        """
        full = os.path.abspath(path)
        flags, seconds = nb_seconds(flags, seconds)
        if full not in locks:
            _Struct.__init__(self,
                             path=full,
                             handle=None,
                             fd=None,
                             flags=flags,
                             seconds=seconds)
            locks[self.path] = self
Esempio n. 14
0
 def __init__(self, image=Image(), options=Options()):
     _Struct.__init__(self, image=image, options=options)
Esempio n. 15
0
 def __init__(self, root="/tmp/deimos", optimistic=False):
     _Struct.__init__(self, root=root,
                            optimistic=optimistic,
                            lock=os.path.join(root, "cleanup"))
Esempio n. 16
0
 def __init__(self, unpack=True):
     _Struct.__init__(self, unpack=coercebool(unpack))
Esempio n. 17
0
 def __init__(self, console=None, syslog=None):
     _Struct.__init__(self, console=coerceloglevel(console), syslog=coerceloglevel(syslog))
Esempio n. 18
0
 def __init__(self, default=[], append=[], ignore=False):
     _Struct.__init__(self,
                      default=coercearray(default),
                      append=coercearray(append),
                      ignore=coercebool(ignore))
Esempio n. 19
0
 def __init__(self, unpack=False, onlaunch=[], ondestroy=[]):
     _Struct.__init__(self, onlaunch=coercearray(onlaunch), ondestroy=coercearray(ondestroy))
Esempio n. 20
0
 def __init__(self, image=Image(), options=Options()):
     _Struct.__init__(self, image=image, options=options)
Esempio n. 21
0
 def __init__(self, console=None, syslog=None):
     _Struct.__init__(self,
                      console=coerceloglevel(console),
                      syslog=coerceloglevel(syslog))
Esempio n. 22
0
 def __init__(self, **properties):
     for k in properties.keys():
         properties[k] = coerceoption(properties[k])
     _Struct.__init__(self, **properties)
Esempio n. 23
0
 def __init__(self, root, docker_id=None, mesos_id=None, executor_id=None):
     _Struct.__init__(self, root=os.path.abspath(root),
                            docker_id=docker_id,
                            mesos_id=mesos_id,
                            executor_id=executor_id,
                            timestamp=None)
Esempio n. 24
0
 def __init__(self, default=None, ignore=False):
     _Struct.__init__(self, default=default, ignore=coercebool(ignore))
Esempio n. 25
0
 def __init__(self, root="/tmp/deimos"):
     if ":" in root:
         raise ValueError("Deimos root storage path must not contain ':'")
     _Struct.__init__(self, root=root)
Esempio n. 26
0
 def __init__(self, default=[], append=[], ignore=False):
     _Struct.__init__(self, default=coercearray(default), append=coercearray(append), ignore=coercebool(ignore))
Esempio n. 27
0
 def __init__(self, root="/tmp/deimos"):
     if ":" in root:
         raise ValueError("Deimos root storage path must not contain ':'")
     _Struct.__init__(self, root=root)
Esempio n. 28
0
 def __init__(self, unpack=True):
     _Struct.__init__(self, unpack=coercebool(unpack))
Esempio n. 29
0
 def __init__(self, unpack=False, onlaunch=[], ondestroy=[]):
     _Struct.__init__(self,
                      onlaunch=coercearray(onlaunch),
                      ondestroy=coercearray(ondestroy))
Esempio n. 30
0
 def __init__(self, **properties):
     for k in properties.keys():
         properties[k] = coerceoption(properties[k])
     _Struct.__init__(self, **properties)
Esempio n. 31
0
 def __init__(self, root="/tmp/deimos", optimistic=False):
     _Struct.__init__(self, root=root,
                            optimistic=optimistic,
                            lock=os.path.join(root, "cleanup"))
Esempio n. 32
0
 def __init__(self, default=None, ignore=False):
     _Struct.__init__(self, default=default, ignore=coercebool(ignore))
Esempio n. 33
0
 def __init__(self, **cgroups_path_mapping):
     properties = {}
     for k, v in cgroups_path_mapping.items():
         properties[k] = construct(v, k)
     _Struct.__init__(self, **properties)
     log.debug(" ".join(self.keys()))
Esempio n. 34
0
 def __init__(self, **cgroups_path_mapping):
     properties = {}
     for k, v in cgroups_path_mapping.items():
         properties[k] = construct(v, k)
     _Struct.__init__(self, **properties)
     log.debug(" ".join(self.keys()))
Esempio n. 35
0
 def __init__(self, cid=None, pid=None, exit=None):
     _Struct.__init__(self, cid=cid, pid=pid, exit=exit)