Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Loading
osdu-cli
Commits
1d4abcd0
Commit
1d4abcd0
authored
Feb 16, 2022
by
Mark Hewitt
Browse files
Add description option to entitlements add group
parent
1a38e227
Pipeline
#93991
passed with stages
in 2 minutes and 5 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.rst
View file @
1d4abcd0
...
...
@@ -31,9 +31,10 @@ Change Log
0.0.34
------
- Bump sdk version to 0.0.1
1
- Bump sdk version to 0.0.1
2
- Added legal add and delete commands
- Fix entitlements add group error
- Add description option to entitlements add group
0.0.33
------
...
...
setup.py
View file @
1d4abcd0
...
...
@@ -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.1
1
"
,
"requests"
,
"tabulate"
,
"msal"
],
install_requires
=
[
"click"
,
"jmespath"
,
"osdu-sdk==0.0.1
2
"
,
"requests"
,
"tabulate"
,
"msal"
],
project_urls
=
{
"Issue Tracker"
:
"https://community.opengroup.org/osdu/platform/data-flow/data-loading/osdu-cli/-/issues"
,
},
...
...
src/osducli/commands/entitlements/groups/add.py
View file @
1d4abcd0
...
...
@@ -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
tests/test_cliclient.py
View file @
1d4abcd0
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment