Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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
Exemplo n.º 7
0
Arquivo: cmd.py Projeto: 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)
Exemplo 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)
Exemplo 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)
Exemplo 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())
Exemplo 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())
Exemplo 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)
Exemplo 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
Exemplo n.º 14
0
 def __init__(self, image=Image(), options=Options()):
     _Struct.__init__(self, image=image, options=options)
Exemplo n.º 15
0
 def __init__(self, root="/tmp/deimos", optimistic=False):
     _Struct.__init__(self, root=root,
                            optimistic=optimistic,
                            lock=os.path.join(root, "cleanup"))
Exemplo n.º 16
0
 def __init__(self, unpack=True):
     _Struct.__init__(self, unpack=coercebool(unpack))
Exemplo n.º 17
0
 def __init__(self, console=None, syslog=None):
     _Struct.__init__(self, console=coerceloglevel(console), syslog=coerceloglevel(syslog))
Exemplo n.º 18
0
 def __init__(self, default=[], append=[], ignore=False):
     _Struct.__init__(self,
                      default=coercearray(default),
                      append=coercearray(append),
                      ignore=coercebool(ignore))
Exemplo n.º 19
0
 def __init__(self, unpack=False, onlaunch=[], ondestroy=[]):
     _Struct.__init__(self, onlaunch=coercearray(onlaunch), ondestroy=coercearray(ondestroy))
Exemplo n.º 20
0
 def __init__(self, image=Image(), options=Options()):
     _Struct.__init__(self, image=image, options=options)
Exemplo n.º 21
0
 def __init__(self, console=None, syslog=None):
     _Struct.__init__(self,
                      console=coerceloglevel(console),
                      syslog=coerceloglevel(syslog))
Exemplo n.º 22
0
 def __init__(self, **properties):
     for k in properties.keys():
         properties[k] = coerceoption(properties[k])
     _Struct.__init__(self, **properties)
Exemplo 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)
Exemplo n.º 24
0
 def __init__(self, default=None, ignore=False):
     _Struct.__init__(self, default=default, ignore=coercebool(ignore))
Exemplo 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)
Exemplo n.º 26
0
 def __init__(self, default=[], append=[], ignore=False):
     _Struct.__init__(self, default=coercearray(default), append=coercearray(append), ignore=coercebool(ignore))
Exemplo 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)
Exemplo n.º 28
0
 def __init__(self, unpack=True):
     _Struct.__init__(self, unpack=coercebool(unpack))
Exemplo n.º 29
0
 def __init__(self, unpack=False, onlaunch=[], ondestroy=[]):
     _Struct.__init__(self,
                      onlaunch=coercearray(onlaunch),
                      ondestroy=coercearray(ondestroy))
Exemplo n.º 30
0
 def __init__(self, **properties):
     for k in properties.keys():
         properties[k] = coerceoption(properties[k])
     _Struct.__init__(self, **properties)
Exemplo n.º 31
0
 def __init__(self, root="/tmp/deimos", optimistic=False):
     _Struct.__init__(self, root=root,
                            optimistic=optimistic,
                            lock=os.path.join(root, "cleanup"))
Exemplo n.º 32
0
 def __init__(self, default=None, ignore=False):
     _Struct.__init__(self, default=default, ignore=coercebool(ignore))
Exemplo 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()))
Exemplo 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()))
Exemplo n.º 35
0
 def __init__(self, cid=None, pid=None, exit=None):
     _Struct.__init__(self, cid=cid, pid=pid, exit=exit)