Skip to content

Commit d5b08d4

Browse files
committed
Re-enable acs deployment
in contentctl.py. Print out what is returned from ACS, even on success.
1 parent 1c2ef2f commit d5b08d4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

contentctl/actions/deploy_acs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ def execute(self, config: deploy_acs, appinspect_token:str) -> None:
4141
# Request went through and completed, but may have returned a non-successful error code.
4242
# This likely includes a more verbose response describing the error
4343
res.raise_for_status()
44+
print(res.json())
4445
except Exception as e:
4546
try:
4647
error_text = res.json()
4748
except Exception as e:
4849
error_text = "No error text - request failed"
4950
formatted_error_text = pprint.pformat(error_text)
51+
print("While this may not be the cause of your error, ensure that the uid and appid of your Private App does not exist in Splunkbase\n"
52+
"ACS cannot deploy and app with the same uid or appid as one that exists in Splunkbase.")
5053
raise Exception(f"Error installing to stack '{config.splunk_cloud_stack}' (stack_type='{config.stack_type}') via ACS:\n{formatted_error_text}")
5154

5255
print(f"'{config.getPackageFilePath(include_version=False)}' successfully installed to stack '{config.splunk_cloud_stack}' (stack_type='{config.stack_type}') via ACS!")

contentctl/contentctl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from contentctl.actions.reporting import ReportingInputDto, Reporting
2020
from contentctl.actions.inspect import Inspect
2121
from contentctl.input.yml_reader import YmlReader
22+
from contentctl.actions.deploy_acs import Deploy
2223
from contentctl.actions.release_notes import ReleaseNotes
2324

2425
# def print_ascii_art():
@@ -95,8 +96,11 @@ def new_func(config:new):
9596

9697

9798
def deploy_acs_func(config:deploy_acs):
98-
#This is a bit challenging to get to work with the default values.
99-
raise Exception("deploy acs not yet implemented")
99+
print("Building and inspecting app...")
100+
token = inspect_func(config)
101+
print("App successfully built and inspected.")
102+
print("Deploying app...")
103+
Deploy().execute(config, token)
100104

101105
def test_common_func(config:test_common):
102106
if type(config) == test:

0 commit comments

Comments
 (0)