]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/ansible: Python 3 fix
authorSebastian Wagner <sebastian.wagner@suse.com>
Thu, 20 Dec 2018 08:15:53 +0000 (09:15 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 20 Dec 2018 08:15:53 +0000 (09:15 +0100)
Also: Some minor cleanup.
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/ansible/ansible_runner_svc.py
src/pybind/mgr/ansible/module.py

index 2989c89ce05f88fd36743d073061d8a6c8ac9fd3..a7dd30f1724a7cd37c7aedabd0efb77c2cb523f2 100644 (file)
@@ -1,13 +1,10 @@
 """
-Tool module to interact with the Ansible Runner Service
+Client module to interact with the Ansible Runner Service
 """
 import requests
 import json
 import re
 
-# Ansible Runner events finished
-
-
 # Ansible Runner service API endpoints
 API_URL = "api"
 LOGIN_URL = "api/v1/login"
@@ -45,7 +42,6 @@ class PlayBookExecution(object):
         # Params used in the playbook
         self.params = the_params
 
-        # Logger
         self.log = logger
 
     def launch(self):
@@ -165,8 +161,6 @@ class Client(object):
         """ Login with user credentials to obtain a valid token
         """
 
-        response = None
-
         the_url = "%s/%s" % (self.server_url, LOGIN_URL)
         response = requests.get(the_url,
                                 auth = self.auth,
index fcca13ef2d20e6cefc5eb1c6af22b1a1baf0a5ae..0d2210324a855a8fddbab783296d262a57376850 100644 (file)
@@ -4,22 +4,14 @@ ceph-mgr Ansible orchestrator module
 The external Orchestrator is the Ansible runner service (RESTful https service)
 """
 
-# Python stuff
-from threading import Event
-import errno
 import json
 
-# Ceph stuff
 from mgr_module import MgrModule
 import orchestrator
 
-# Orchestrator stuff
-# A Client is used to communicate with the Ansible Runner service
-from ansible_runner_svc import Client, PlayBookExecution, ExecutionStatusCode,\
+from .ansible_runner_svc import Client, PlayBookExecution, ExecutionStatusCode,\
                                EVENT_DATA_URL
 
-# Constants section
-
 # Time to clean the completions list
 WAIT_PERIOD = 10
 
@@ -197,8 +189,6 @@ class Module(MgrModule, orchestrator.Orchestrator):
     ]
 
     def __init__(self, *args, **kwargs):
-        """
-        """
         super(Module, self).__init__(*args, **kwargs)
 
         self.run = False