diff --git a/bin/get_formulas.py b/bin/get_formulas.py index d7e2bfc..b71e408 100755 --- a/bin/get_formulas.py +++ b/bin/get_formulas.py @@ -42,8 +42,6 @@ def clone_or_pull(DEST): git(['pull', '-q'], cwd=FULL_PATH) else: git(['clone', '-q', url, FULL_PATH]) - git(['remote', 'add', 'opensuse', opensuse_fork_url], cwd=FULL_PATH) - git(['fetch', '-q', 'opensuse'], cwd=FULL_PATH) def use_pygit2_to_clone_or_pull_repo(): import pygit2 @@ -58,7 +56,6 @@ def clone_or_pull(DEST): namespace = data.get('namespace', 'saltstack-formulas') prefix = data.get('prefix', '') url = 'https://github.com/%s/%s%s-formula' % (namespace, prefix, formula) - opensuse_fork_url = 'https://gitlab.infra.opensuse.org/saltstack-formulas/%s-formula' % formula FULL_PATH = '%s/%s-formula' % (DEST, formula) use_git_to_clone_or_pull_repo() @@ -68,29 +65,21 @@ def create_symlinks(DEST): os.symlink('%s/%s-formula/%s' % (DEST, formula, formula), '/srv/salt/%s' % formula) -def enable_remote(REMOTE, DEST): - def use_git_to_enable_remote(): - for formula in FORMULAS.keys(): - FULL_PATH = '%s/%s-formula' % (DEST, formula) - git(['checkout', '-qB', 'master', '%s/master' % REMOTE], cwd=FULL_PATH) - - with open('FORMULAS.yaml', 'r') as f: FORMULAS = yaml.load(f) -parser = argparse.ArgumentParser(description='Loads the formulas from FORMULAS.yaml and optionally clones them in a specified destination. Optionally it can also create a symlink from the cloned path to /srv/salt, useful for the CI worker. The internal gitlab fork will also be added as secondary remote.') +parser = argparse.ArgumentParser(description='Loads the formulas from FORMULAS.yaml and optionally clones them in a specified destination. Optionally it can also create a symlink from the cloned path to /srv/salt, useful for the CI worker.') parser.add_argument('-p', '--pull-requests', action='store_true', help='Prints the status of the Pull Requests that are defined in FORMULAS.yaml under "pending".') parser.add_argument('-d', '--destination', nargs=1, help='Destination absolute path of the cloned (or to-be-cloned) repositories of the formulas.') -parser.add_argument('-c', '--clone', action='store_true', help='Clone the formulas to the destination specified with "--destination". The gitlab fork will also be added as remote. If the repository is already cloned, then both remotes will be pulled/fetched.') +parser.add_argument('-c', '--clone', action='store_true', help='Clone the formulas to the destination specified with "--destination". If the repository is already cloned, then it will be pulled/fetched.') parser.add_argument('-s', '--symlink', action='store_true', help='Creates symlink from the specified destination to /srv/salt.') -parser.add_argument('-r', '--remote', nargs=1, help='Enable the specified remote. Available remotes: origin, opensuse. Default: origin') args = parser.parse_args() if args.pull_requests: check_open_pull_requests() # Every option below requires the --destination argument to be set -if args.clone or args.symlink or args.remote: +if args.clone or args.symlink: if not args.destination or not os.path.isabs(args.destination[0]): parser.print_help() sys.exit(1) @@ -100,12 +89,6 @@ if args.clone or args.symlink or args.remote: if args.symlink: create_symlinks(args.destination[0]) - - if args.remote: - if args.remote[0] not in ['origin', 'opensuse']: - parser.print_help() - sys.exit(1) - enable_remote(args.remote[0], args.destination[0]) else: parser.print_help() sys.exit(1)