From b93d451711de84a510386124575a9d238629f8ad Mon Sep 17 00:00:00 2001 From: jain-naman-sf Date: Thu, 12 Oct 2023 12:41:32 +0530 Subject: [PATCH 1/4] Fixed Log line issue for cci org info --- cumulusci/core/config/sfdx_org_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulusci/core/config/sfdx_org_config.py b/cumulusci/core/config/sfdx_org_config.py index ddf5c75871..3ff4f1634e 100644 --- a/cumulusci/core/config/sfdx_org_config.py +++ b/cumulusci/core/config/sfdx_org_config.py @@ -25,7 +25,7 @@ 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}") + # 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 From 372791f7661e1d1b9d1e2c82f9caec368d260d5c Mon Sep 17 00:00:00 2001 From: jain-naman-sf Date: Mon, 16 Oct 2023 16:46:45 +0530 Subject: [PATCH 2/4] Review Changes --- cumulusci/cli/org.py | 2 +- cumulusci/core/config/sfdx_org_config.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cumulusci/cli/org.py b/cumulusci/cli/org.py index 301e423581..e26df3d09e 100644 --- a/cumulusci/cli/org.py +++ b/cumulusci/cli/org.py @@ -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( diff --git a/cumulusci/core/config/sfdx_org_config.py b/cumulusci/core/config/sfdx_org_config.py index 3ff4f1634e..323f5ab155 100644 --- a/cumulusci/core/config/sfdx_org_config.py +++ b/cumulusci/core/config/sfdx_org_config.py @@ -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 @@ -196,7 +196,7 @@ def force_refresh_oauth_token(self): message = f"Message: {nl.join(stdout_list)}" raise SfdxOrgException(message) - def refresh_oauth_token(self, keychain): + def refresh_oauth_token(self, keychain, print_json): """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 @@ -206,7 +206,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 From b6c4d57d8836a9897c42f72916c7e647700d3d60 Mon Sep 17 00:00:00 2001 From: jain-naman-sf Date: Tue, 17 Oct 2023 10:36:21 +0530 Subject: [PATCH 3/4] Test Fixes --- cumulusci/core/config/sfdx_org_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulusci/core/config/sfdx_org_config.py b/cumulusci/core/config/sfdx_org_config.py index 323f5ab155..5a82f4134a 100644 --- a/cumulusci/core/config/sfdx_org_config.py +++ b/cumulusci/core/config/sfdx_org_config.py @@ -196,7 +196,7 @@ def force_refresh_oauth_token(self): message = f"Message: {nl.join(stdout_list)}" raise SfdxOrgException(message) - def refresh_oauth_token(self, keychain, print_json): + 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 From dc8c550cbf09669a479644716395f905a2ca9cd3 Mon Sep 17 00:00:00 2001 From: jain-naman-sf Date: Wed, 18 Oct 2023 15:52:21 +0530 Subject: [PATCH 4/4] Tf --- cumulusci/core/config/sfdx_org_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cumulusci/core/config/sfdx_org_config.py b/cumulusci/core/config/sfdx_org_config.py index 5a82f4134a..c466778047 100644 --- a/cumulusci/core/config/sfdx_org_config.py +++ b/cumulusci/core/config/sfdx_org_config.py @@ -196,6 +196,7 @@ def force_refresh_oauth_token(self): message = f"Message: {nl.join(stdout_list)}" raise SfdxOrgException(message) + # 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"):