Skip to content

Commit

Permalink
Use customized ArgumentParser everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
spbnick committed Aug 4, 2020
1 parent 3ab6439 commit 82762c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
15 changes: 7 additions & 8 deletions kcidb/mq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"""Kernel CI report message queue"""

import argparse
import json
import sys
from google.cloud import pubsub
from google.api_core.exceptions import DeadlineExceeded
from kcidb import io
from kcidb import io, misc


class Publisher:
Expand Down Expand Up @@ -153,7 +152,7 @@ def publisher_init_main():
"""Execute the kcidb-mq-publisher-init command-line tool"""
description = \
'kcidb-mq-publisher-init - Initialize a Kernel CI report publisher'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project with the message queue',
Expand All @@ -173,7 +172,7 @@ def publisher_cleanup_main():
"""Execute the kcidb-mq-publisher-cleanup command-line tool"""
description = \
'kcidb-mq-publisher-cleanup - Cleanup a Kernel CI report publisher'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project with the message queue',
Expand All @@ -194,7 +193,7 @@ def publisher_publish_main():
description = \
'kcidb-mq-publisher-publish - ' \
'Publish with a Kernel CI report publisher'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project with the message queue',
Expand All @@ -216,7 +215,7 @@ def subscriber_init_main():
"""Execute the kcidb-mq-subscriber-init command-line tool"""
description = \
'kcidb-mq-subscriber-init - Initialize a Kernel CI report subscriber'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project with the message queue',
Expand All @@ -241,7 +240,7 @@ def subscriber_cleanup_main():
"""Execute the kcidb-mq-subscriber-cleanup command-line tool"""
description = \
'kcidb-mq-subscriber-cleanup - Cleanup a Kernel CI report subscriber'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project with the message queue',
Expand All @@ -266,7 +265,7 @@ def subscriber_pull_main():
"""Execute the kcidb-mq-subscriber-pull command-line tool"""
description = \
'kcidb-mq-subscriber-pull - Pull with a Kernel CI report subscriber'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project with the message queue',
Expand Down
3 changes: 1 addition & 2 deletions kcidb/spool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
every notification email is sent, and sent only once (as well as possible).
"""

import argparse
import datetime
import email
import email.policy
Expand Down Expand Up @@ -254,7 +253,7 @@ def wipe_main():
"""Execute the kcidb-spool-wipe command-line tool"""
description = \
'kcidb-spool-wipe - Remove (old) notifications from the spool'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
'-p', '--project',
help='ID of the Google Cloud project containing the spool. '
Expand Down
3 changes: 1 addition & 2 deletions kcidb/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Kernel CI reporting test catalog"""

import argparse
import sys
import yaml
import requests
Expand All @@ -12,7 +11,7 @@
def validate_main():
"""Execute the kcidb-tests-validate command-line tool"""
description = 'kcidb-tests-validate - Validate test catalog YAML'
parser = argparse.ArgumentParser(description=description)
parser = misc.ArgumentParser(description=description)
parser.add_argument(
"-u", "--urls",
action='store_true',
Expand Down

0 comments on commit 82762c6

Please sign in to comment.