def _init(self): AcquisitionStep._init(self) self.dest_dirs = [] self.uid = os.getuid() if self.args.dest_dirs != "": for tmp in self.args.dest_dirs.split(','): if '/' not in tmp or tmp.startswith('/'): raise Exception("invalid target: %s in dest-dirs: %s" % (tmp, self.args.dest_dirs)) tmp2 = tmp.split('/') if len(tmp2) != 2: raise Exception("invalid target: %s in dest-dirs: %s" % (tmp, self.args.dest_dirs)) plugin_name = tmp2[0].strip() if tmp2[1].endswith('*'): hardlink = True step_name = tmp2[1][:-1].strip() else: hardlink = False step_name = tmp2[1].strip() self.dest_dirs.append((plugin_name, step_name, hardlink)) self.add_virtual_trace(plugin_name, step_name)
def _init(self): AcquisitionStep._init(self) self.__xafs = {} if self.args.dest_dir is None: raise Exception('you have to set a dest-dir argument') if self.args.dest_dir == "FIXME": raise Exception('you have to set a dest-dir argument') if '/' not in self.args.dest_dir: raise Exception("invalid dest_dir: %s" % self.args.dest_dir) if self.args.dest_dir.startswith('/'): raise Exception("invalid dest_dir: %s, must be something like: " "plugin_name/step_name" % self.args.dest_dir) plugin_name = self.args.dest_dir.split('/')[0] step_name = self.args.dest_dir.split('/')[1] self.add_virtual_trace(plugin_name, step_name) self.add_virtual_trace(">delete", "giveup") self.dest_dir = get_plugin_step_directory_path(plugin_name, step_name) mkdir_p_or_die(self.dest_dir) self.retry_total = self.args.retry_total self.retry_min_wait = self.args.retry_min_wait self.retry_max_wait = self.args.retry_max_wait self.retry_backoff = self.args.retry_backoff
def _init(self): AcquisitionStep._init(self) if self.args.dest_dir == "FIXME": raise Exception("dest_dir is not set") if '/' not in self.args.dest_dir: raise Exception("invalid dest_dir: %s" % self.args.dest_dir) if self.args.dest_dir.startswith('/'): self.dest_dir = self.args.dest_dir else: plugin_name = self.args.dest_dir.split('/')[0] step_name = self.args.dest_dir.split('/')[1] self.dest_dir = get_plugin_step_directory_path(plugin_name, step_name) mkdir_p_or_die(self.dest_dir) self.add_virtual_trace(self.dest_dir) try: if self.args.drop_tags == "AUTO": self.drop_tags = self.args.dest_dir.startswith('/') elif self.args.drop_tags == "1": self.drop_tags = True elif self.args.drop_tags == "0": self.drop_tags = False else: raise Exception("invalid value for drop_tags configuration " "key: %s" % self.args.drop_tags) except AttributeError: self.drop_tags = True try: if self.args.force_chmod == "null": self.force_chmod = "" else: self.force_chmod = self.args.force_chmod except AttributeError: self.force_chmod = "" if self.args.dest_basename == "": raise Exception("dest_basename can't be empty") self.dest_basename = self.args.dest_basename
def test_constructor_get_name_not_overridden(self): self.assertRaises(NotImplementedError, lambda: AcquisitionStep())