IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 5, 2019, 9:17:31 AM (7 years ago)
Author:
fairlamb
Message:

Added rsync to jira/conf schema and tests to boot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ipp-350_add_to_jira_conf_backups/backup.py

    r40973 r41059  
    8383
    8484        self.read_config_and_schema(config, schema)
    85         # self.read_copy_config_section(config, schema)
    86         # self.read_tar_config_section(config, schema)
    87         # self.read_rsync_config_section(config, schema)
    88         # self.read_mysqldump_config_section(config, schema)
    8985
    9086    def read_config_and_schema(self, config: ConfigParser, schema: ConfigSchema):
     
    206202        self.target_backup_paths_ok(raise_error=True)
    207203        backup_paths = self.default_dict['backup_paths']
    208         for bp in backup_paths:
    209             # if not path.exists(bp):
    210             #     raise errs.ValidationError(f"ValidationError: target path does not exist: {bp}")
    211 
    212             for s in self.rsync_dict['sources']:
    213                 if not path.exists(s):
     204
     205        sources = self.rsync_dict['sources']
     206        for i in range(0, len(sources)):
     207            s = sources[i]
     208            if not path.exists(s):
    214209                    raise errs.ValidationError(f"ValidationError: target path does not exist: {s}")
     210
     211            for bp in backup_paths:
    215212                try:
    216213                    args = [s, bp]
     214
    217215                    if 'additional_args' in self.rsync_dict.keys():
    218216                        args = args + self.rsync_dict['additional_args']
    219217                    sub_utils.local_rsync_wrapper(args)
     218
    220219                except errs.SubprocessError as e:
    221220                    raise errs.SubprocessError( f"Error: rsync\n"
Note: See TracChangeset for help on using the changeset viewer.