Commit d983e9aa authored by Mark Hewitt's avatar Mark Hewitt
Browse files

Merge branch 'feature/entitlements-add-description' into 'main'

Add description option to entitlements add group

Closes #19

See merge request !18
parents 1a38e227 1d4abcd0
Pipeline #93993 passed with stages
in 3 minutes and 18 seconds
......@@ -31,9 +31,10 @@ Change Log
0.0.34
------
- Bump sdk version to 0.0.11
- Bump sdk version to 0.0.12
- Added legal add and delete commands
- Fix entitlements add group error
- Add description option to entitlements add group
0.0.33
------
......
......@@ -59,7 +59,7 @@ setup(
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
install_requires=["click", "jmespath", "osdu-sdk==0.0.11", "requests", "tabulate", "msal"],
install_requires=["click", "jmespath", "osdu-sdk==0.0.12", "requests", "tabulate", "msal"],
project_urls={
"Issue Tracker": "https://community.opengroup.org/osdu/platform/data-flow/data-loading/osdu-cli/-/issues",
},
......
......@@ -22,19 +22,21 @@ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
# click entry point
@click.command(cls=CustomClickCommand)
@click.option("-g", "--group", help="Email address of the group", required=True)
@click.option("-d", "--description", help="Description")
@handle_cli_exceptions
@command_with_output(None)
def _click_command(state: State, group: str):
def _click_command(state: State, group: str, description: str):
"""Add a group."""
return add_group(state, group)
return add_group(state, group, description)
def add_group(state: State, group: str) -> dict:
def add_group(state: State, group: str, description: str = None) -> dict:
"""Add a group
Args:
state (State): Global state
group (str): Email address of the group
description (str): Description for the group
Returns:
dict: Response from service
......@@ -42,5 +44,5 @@ def add_group(state: State, group: str) -> dict:
connection = CliOsduClient(state.config)
entitlements_client = EntitlementsClient(connection)
json_response = entitlements_client.add_group(group)
json_response = entitlements_client.add_group(group, description)
return json_response
......@@ -19,10 +19,9 @@ from mock import MagicMock, Mock, PropertyMock, patch
from nose2.tools import params
from osdu.client import OsduClient
from osdu.identity import OsduTokenCredential
from requests.models import HTTPError
from testfixtures import LogCapture
from osducli.cliclient import MSG_HTTP_ERROR, CliOsduClient
from osducli.cliclient import CliOsduClient
from osducli.config import CONFIG_AUTHENTICATION_MODE
from tests.helpers import MockConfig, mock_config_values
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment