From ca2af7625c63eeedfafce3eaf1e8be2e4e323f2e Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 20 Dec 2018 09:15:53 +0100 Subject: [PATCH] mgr/ansible: Python 3 fix Also: Some minor cleanup. Signed-off-by: Sebastian Wagner --- src/pybind/mgr/ansible/ansible_runner_svc.py | 8 +------- src/pybind/mgr/ansible/module.py | 12 +----------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/pybind/mgr/ansible/ansible_runner_svc.py b/src/pybind/mgr/ansible/ansible_runner_svc.py index 2989c89ce05f..a7dd30f1724a 100644 --- a/src/pybind/mgr/ansible/ansible_runner_svc.py +++ b/src/pybind/mgr/ansible/ansible_runner_svc.py @@ -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, diff --git a/src/pybind/mgr/ansible/module.py b/src/pybind/mgr/ansible/module.py index fcca13ef2d20..0d2210324a85 100644 --- a/src/pybind/mgr/ansible/module.py +++ b/src/pybind/mgr/ansible/module.py @@ -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 -- 2.47.3