Skip to content

Commit

Permalink
Merge pull request #3675 from SFDO-Tooling/bug/cci-org-info-log-line-…
Browse files Browse the repository at this point in the history
…removed

Fixed Log line issue for cci org info
  • Loading branch information
jkasturi-sf authored Oct 20, 2023
2 parents 93dc402 + dc8c550 commit e48c54c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cumulusci/cli/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def calculate_org_days(info):
@pass_runtime(require_project=False, require_keychain=True)
def org_info(runtime, org_name, print_json):
org_name, org_config = runtime.get_org(org_name)
org_config.refresh_oauth_token(runtime.keychain)
org_config.refresh_oauth_token(runtime.keychain, print_json)
console = Console()
if print_json:
click.echo(
Expand Down
9 changes: 5 additions & 4 deletions cumulusci/core/config/sfdx_org_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def sfdx_info(self):

username = self.config.get("username")
assert username is not None, "SfdxOrgConfig must have a username"

self.logger.info(f"Getting org info from Salesforce CLI for {username}")
if not self.print_json:
self.logger.info(f"Getting org info from Salesforce CLI for {username}")

# Call force:org:display and parse output to get instance_url and
# access_token
Expand Down Expand Up @@ -196,7 +196,8 @@ def force_refresh_oauth_token(self):
message = f"Message: {nl.join(stdout_list)}"
raise SfdxOrgException(message)

def refresh_oauth_token(self, keychain):
# Added a print json argument to check whether it is there or not
def refresh_oauth_token(self, keychain, print_json=False):
"""Use sfdx force:org:describe to refresh token instead of built in OAuth handling"""
if hasattr(self, "_sfdx_info"):
# Cache the sfdx_info for 1 hour to avoid unnecessary calls out to sfdx CLI
Expand All @@ -206,7 +207,7 @@ def refresh_oauth_token(self, keychain):

# Force a token refresh
self.force_refresh_oauth_token()

self.print_json = print_json
# Get org info via sfdx force:org:display
self.sfdx_info
# Get additional org info by querying API
Expand Down

0 comments on commit e48c54c

Please sign in to comment.