Skip to content

Commit

Permalink
fix formatting (flake8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schleifer committed Feb 24, 2022
1 parent d3293c1 commit 0c45519
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions scripts/generate_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,28 @@
print('Please provide the environment variable GITLAB_TOKEN')
sys.exit(1)

parser = argparse.ArgumentParser(description='Script to generate vcsconfig for all repositories under the given namespace (needs Gitlab >= 10.3)')
parser.add_argument('gitlab_host', type=str, help='url to the gitlab instance')
parser.add_argument('gitlab_namespace', type=str, help='namespace/group in gitlab to generate vcsconfig for')
parser.add_argument('-c', type=str, help='path to the target config file (default: ./vcspull.yaml)', dest='config_file_name', required=False, default='./vcspull.yaml')
parser = argparse.ArgumentParser(
description='Script to generate vcsconfig for all repositories \
under the given namespace (needs Gitlab >= 10.3)'
)
parser.add_argument(
'gitlab_host',
type=str,
help='url to the gitlab instance'
)
parser.add_argument(
'gitlab_namespace',
type=str,
help='namespace/group in gitlab to generate vcsconfig for'
)
parser.add_argument(
'-c',
type=str,
help='path to the target config file (default: ./vcspull.yaml)',
dest='config_file_name',
required=False,
default='./vcspull.yaml'
)

args = vars(parser.parse_args())
gitlab_host = args['gitlab_host']
Expand All @@ -24,10 +42,16 @@

try:
if os.path.isfile(config_filename):
result = input('The target config file (%s) already exists, do you want to overwrite it? [y/N] ' % (config_filename))
result = input(
'The target config file (%s) already exists, \
do you want to overwrite it? [y/N] ' % (config_filename)
)

if result != 'y':
print('Aborting per user request as existing config file (%s) should not be overwritten!' % (config_filename))
print(
'Aborting per user request as existing config file (%s) \
should not be overwritten!' % (config_filename)
)
sys.exit(0)

config_file = open(config_filename, 'w')
Expand Down

0 comments on commit 0c45519

Please sign in to comment.