Skip to content

Commit aa1b5b0

Browse files
committed
Fix cannot import name 'cli' from '__main__' error
* Closes #69
1 parent 3dffa11 commit aa1b5b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

datadog_callback.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
import ansible
1818
from ansible.plugins.callback import CallbackBase
19-
from __main__ import cli
19+
try:
20+
from __main__ import cli
21+
except ImportError:
22+
cli = True
2023

2124
ANSIBLE_ABOVE_28 = False
2225
if IMPORT_ERROR is None and version.parse(ansible.__version__) >= version.parse('2.8.0'):

0 commit comments

Comments
 (0)