def __init__(self, method, data): Resource.__init__(self, method, data) self.definition = { 'id': Field(type=int), 'property': Field(type=str) }
def __init__(self, rid, path, opts, **kwargs): Resource.__init__(self, rid, type="share.nfs", **kwargs) if not which("share"): raise ex.excInitError("share is not installed") self.label = "nfs:" + path self.path = path try: self.opts = self.parse_opts(opts) except ex.excError as e: raise ex.excInitError(str(e))
def __init__(self, rid=None, 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, **kwargs): Resource.__init__(self, rid, **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 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
def __init__(self, rid, path, opts, **kwargs): Resource.__init__(self, rid, type="share.nfs", **kwargs) if not which("exportfs"): raise ex.excInitError("exportfs is not installed") self.label = "nfs:" + path self.path = path l = opts.replace('\\', '').split() self.opts = {} for e in l: try: client, opts = self.parse_entry(e) except ex.excError as e: raise ex.excInitError(str(e)) self.opts[client] = opts
def __init__(self, rid, type="data", **kwargs): Resource.__init__(self, rid, type=type) self.options = Storage(kwargs)