Exemple #1
0
    def __init__(self, path=None, opts=None, **kwargs):
        Resource.__init__(self, type="share.nfs", **kwargs)

        if "node.x.share" not in capabilities:
            raise ex.InitError("share is not installed")
        self.label = "nfs:%s" % path
        self.path = path
        try:
            self.opts = self.parse_opts(opts)
        except ex.Error as e:
            raise ex.InitError(str(e))
Exemple #2
0
 def __init__(self, path=None, opts=None, **kwargs):
     Resource.__init__(self, type="share.nfs", **kwargs)
     self.label = "nfs:%s" % path
     self.path = path
     l = opts.replace('\\', '').split()
     self.opts = {}
     for e in l:
         try:
             client, opts = self.parse_entry(e)
         except ex.Error as e:
             raise ex.InitError(str(e))
         self.opts[client] = opts
Exemple #3
0
    def __init__(self,
                 script=None,
                 start=None,
                 stop=None,
                 check=None,
                 info=None,
                 timeout=None,
                 start_timeout=None,
                 stop_timeout=None,
                 check_timeout=None,
                 info_timeout=None,
                 status_log=False,
                 user=None,
                 group=None,
                 cwd=None,
                 environment=None,
                 configs_environment=None,
                 secrets_environment=None,
                 retcodes=None,
                 **kwargs):

        Resource.__init__(self, **kwargs)
        self.script = script
        self.start_seq = start
        self.stop_seq = stop
        self.check_seq = check
        self.info_seq = info
        self.timeout = timeout
        self.user = user
        self.group = group
        self.cwd = cwd
        self.status_log_flag = status_log
        self.start_timeout = start_timeout
        self.stop_timeout = stop_timeout
        self.check_timeout = check_timeout
        self.info_timeout = info_timeout
        self.label = self.type.split(".")[-1]
        self.environment = environment
        self.configs_environment = configs_environment
        self.secrets_environment = secrets_environment
        self.retcodes = retcodes
        if script:
            self.label += ": " + os.path.basename(script)
        elif start:
            self.label += ": " + os.path.basename(start.split()[0])
        self.lockfd = None
        try:
            # compat
            self.sort_key = "app#%d" % int(self.start_seq)
        except (TypeError, ValueError):
            pass
Exemple #4
0
    def __init__(self, sync_max_delay=None, schedule=None, **kwargs):
        self.pausable = True
        if sync_max_delay is None:
            self.sync_max_delay = 1500
        else:
            self.sync_max_delay = sync_max_delay

        if schedule is None:
            self.schedule = "03:59-05:59@121"
        else:
            self.schedule = schedule

        self.stats = {
            "bytes": 0,
            "speed": 0,
            "targets": {},
        }

        Resource.__init__(self, **kwargs)