def osrt_origin_config(apiurl, opts, *args): config = config_load(apiurl, opts.project) if opts.origins_only: print('\n'.join(config_origin_list(config))) else: yaml.Dumper.ignore_aliases = lambda *args : True print(yaml.dump(config))
def test_config(self): attribute_value_save(self.wf.apiurl, self.target_project, 'OriginConfig', 'origins: []') config = config_load(self.wf.apiurl, self.wf.project) self.assertEqual(config['unknown_origin_wait'], False) self.assertEqual(config['review-user'], NAME) memoize_session_reset() self.origin_config_write([{'fakeProject': {}}, {'*~': {}}]) config = config_load(self.wf.apiurl, self.wf.project) self.assertEqual(config_origin_list(config), ['fakeProject', 'fakeProject~']) for _, values in config_origin_generator(config['origins']): self.assertEqual(values['automatic_updates'], True)
def devel_project_simulate_check(self, source_project, target_project): config = config_load(self.apiurl, target_project) origin_list = config_origin_list(config, self.apiurl, target_project, skip_workarounds=True) if '<devel>' not in origin_list: return False, None if len(origin_list) == 1: return source_project, 'only devel origin allowed' if source_project in origin_devel_projects(self.apiurl, target_project): return source_project, 'familiar devel origin' override, who = self.devel_project_simulate_check_command(source_project, target_project) if override: return override, 'change_devel command by {}'.format(who) return False, None