Skip to content

Commit

Permalink
Merge pull request #28 from NewTec-GmbH/release/v1.2.x
Browse files Browse the repository at this point in the history
Release v1.2.0
  • Loading branch information
gabryelreyes authored Oct 10, 2024
2 parents e4a813f + e3cce78 commit 4cf565d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pyPolarionCli"
version = "1.1.2"
version = "1.2.0"
description = "pyPolarionCli is a command-line tool designed for easy access to Polarion work items, e.g. for metric creation."
readme = "README.md"
requires-python = ">=3.9"
Expand Down
16 changes: 14 additions & 2 deletions src/pyPolarionCli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,16 @@ def add_parser() -> argparse.ArgumentParser:
'--password',
type=str,
metavar='<password>',
required=True,
help="The password to authenticate with the Polarion server.")
required=False,
help="The password to authenticate with the Polarion server.\
Is ignored if a token is defined using -t option.")

required_arguments.add_argument('-t',
'--token',
type=str,
metavar='<token>',
required=False,
help="The token to authenticate with the Polarion server.")

required_arguments.add_argument('-s',
'--server',
Expand Down Expand Up @@ -145,6 +153,9 @@ def main() -> Ret:
if args is None:
ret_status = Ret.ERROR_ARGPARSE
parser.print_help()
elif (args.password is None) and (args.token is None):
ret_status = Ret.ERROR_INVALID_ARGUMENTS
LOG.error("Missing password or token!")
else:
# If the verbose flag is set, change the default logging level.
if args.verbose:
Expand All @@ -159,6 +170,7 @@ def main() -> Ret:
client = Polarion(polarion_url=args.server,
user=args.user,
password=args.password,
token=args.token,
verify_certificate=False,
static_service_list=True)
except Exception as e: # pylint: disable=broad-exception-caught
Expand Down

0 comments on commit 4cf565d

Please sign in to comment.