Skip to content

Commit eef98be

Browse files
authored
Merge pull request #66 from britive/develop
v1.1.1
2 parents 162648a + 37a69f4 commit eef98be

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All changes to the package starting with v0.3.1 will be logged here.
44

5+
## v1.1.1 [2023-02-16]
6+
#### What's New
7+
* None
8+
9+
#### Enhancements
10+
* None
11+
12+
#### Bug Fixes
13+
* fix issue with `checkin`, `request submit`, `request withdrawl` due to `PROFILE` parameter changes
14+
15+
#### Dependencies
16+
* None
17+
18+
#### Other
19+
* None
20+
521
## v1.1.0 [2023-02-16]
622
#### What's New
723
* Allowing 2 part `PROFILE` parameters (see documentation for details)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pybritive
3-
version = 1.1.0
3+
version = 1.1.1
44
author = Britive Inc.
55
author_email = support@britive.com
66
description = A pure Python CLI for Britive

src/pybritive/britive_cli.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,24 @@ def checkin(self, profile):
343343
self.login()
344344
parts = self._split_profile_into_parts(profile)
345345

346-
self.b.my_access.checkin_by_name(
346+
ids = self._convert_names_to_ids(
347347
profile_name=parts['profile'],
348348
environment_name=parts['env'],
349349
application_name=parts['app']
350350
)
351351

352+
transaction_id = None
353+
for profile in self.b.my_access.list_checked_out_profiles():
354+
if profile['environmentId'] == ids['environment_id'] and profile['papId'] == ids['profile_id']:
355+
transaction_id = profile['transactionId']
356+
break
357+
if not transaction_id:
358+
raise ValueError(f'no checked out profile found for the given profile')
359+
360+
self.b.my_access.checkin(
361+
transaction_id=transaction_id
362+
)
363+
352364
def _checkout(self, profile_name, env_name, app_name, programmatic, blocktime, maxpolltime, justification):
353365
try:
354366
self.login()
@@ -608,10 +620,15 @@ def request_submit(self, profile, justification):
608620
self.login()
609621
parts = self._split_profile_into_parts(profile)
610622

611-
self.b.my_access.request_approval_by_name(
623+
ids = self._convert_names_to_ids(
612624
profile_name=parts['profile'],
613625
environment_name=parts['env'],
614-
application_name=parts['app'],
626+
application_name=parts['app']
627+
)
628+
629+
self.b.my_access.request_approval(
630+
profile_id=ids['profile_id'],
631+
environment_id=ids['environment_id'],
615632
block_until_disposition=False,
616633
justification=justification
617634
)
@@ -620,12 +637,17 @@ def request_withdraw(self, profile):
620637
self.login()
621638
parts = self._split_profile_into_parts(profile)
622639

623-
self.b.my_access.withdraw_approval_request_by_name(
640+
ids = self._convert_names_to_ids(
624641
profile_name=parts['profile'],
625642
environment_name=parts['env'],
626643
application_name=parts['app']
627644
)
628645

646+
self.b.my_access.withdraw_approval_request(
647+
profile_id=ids['profile_id'],
648+
environment_id=ids['environment_id']
649+
)
650+
629651
def clear_gcloud_auth_key_files(self):
630652
self.config.clear_gcloud_auth_key_files()
631653

0 commit comments

Comments
 (0)