Skip to content

Commit 2377a37

Browse files
authored
Merge pull request #104 from controlm/Support-run-ondemand
Support run ondemand Automation-API Control-M
2 parents 9c03306 + 4060a4e commit 2377a37

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
name="ctm-python-client",
99
packages=find_packages(where="src"),
1010
package_dir={"": "src"},
11-
version="2.4.0",
11+
version="2.4.1",
1212
description="Python Workflows for Control-M",
1313
long_description=long_description,
1414
long_description_content_type='text/markdown',

src/aapi/bases.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def run_on_demand(self, environment: Environment, inpath: str = f'run_on_demand{
6666
file_path: str = None, delete_afterwards: bool = True, open_in_browser: str = None) -> RunMonitor:
6767
# Import circular dependency
6868
from ctm_python_client.core.workflow import Workflow, WorkflowDefaults
69-
from aapi import Job, Folder
69+
from aapi import Folder
7070

71-
if isinstance(self, Job) or (hasattr(self, 'job_list') and self.job_list is not None and len(self.job_list) > 0):
71+
if (hasattr(self, '_type') and 'Job' in self._type) or (hasattr(self, 'job_list') and self.job_list is not None and len(self.job_list) > 0):
7272
try:
7373
on_demand_workflow = Workflow(
7474
environment,
@@ -92,9 +92,12 @@ def run_on_demand(self, environment: Environment, inpath: str = f'run_on_demand{
9292
open_in_browser=open_in_browser
9393
)
9494
except Exception as e:
95-
errors = [err.get('message', '') + ' ' + err.get('item', '')
96-
for err in json.loads(e.body)['errors']]
97-
raise RuntimeError(f"AAPI request failed: {', '.join(errors)}")
95+
if e.body:
96+
errors = [err.get('message', '') + ' ' + err.get('item', '')
97+
for err in json.loads(e.body)['errors']]
98+
raise RuntimeError(f"AAPI request failed: {', '.join(errors)}")
99+
else:
100+
raise e
98101
finally:
99102
on_demand_workflow.clear_all()
100103
else:

src/ctm_python_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '2.4.0'
1+
__version__ = '2.4.1'
22
__author__ = 'BMC Software'

tests/test_sanity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ def test_version_author():
22
import ctm_python_client
33

44
assert ctm_python_client.__author__ == 'BMC Software'
5-
assert ctm_python_client.__version__ == '2.4.0'
5+
assert ctm_python_client.__version__ == '2.4.1'
66

77

0 commit comments

Comments
 (0)