Minor refactoring

* make sure line length is less than 79 per
  https://wiki.openstack.org/wiki/Documentation/Markup_conventions;
* specify a logger name;
* move import statements to the top.
This commit is contained in:
Dmitrii Shcherbakov 2020-04-13 09:30:59 +03:00
parent 6a99f92ae0
commit 1c20dd4e1a
2 changed files with 12 additions and 9 deletions

2
.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
max-line-length = 79

View File

@ -1,22 +1,23 @@
#!/usr/bin/env python3
import logging
import json
import sys
sys.path.append('lib') # noqa
sys.path.append('lib')
import charmhelpers.contrib.storage.linux.ceph as ch_ceph
import charmhelpers.contrib.network.ip as ch_ip
from ops.framework import (
StoredState,
EventBase,
EventsBase,
EventSource,
Object)
import charmhelpers.contrib.storage.linux.ceph as ch_ceph
import charmhelpers.core.hookenv as hookenv
import charmhelpers.contrib.network.ip as ch_ip
import logging
Object
)
logger = logging.getLogger(__name__)
logger = logging.getLogger()
class BrokerAvailableEvent(EventBase):
pass
@ -112,8 +113,8 @@ class CephClientRequires(Object):
logging.info("Json request: {}".format(self.state.broker_req))
rq.set_ops(j['ops'])
except ValueError as err:
logging.info("Unable to decode broker_req: {}. Error {}".format(
self.state.broker_req, err))
logging.info("Unable to decode broker_req: {}. Error {}"
"".format(self.state.broker_req, err))
return rq
def create_replicated_pool(self, name, replicas=3, weight=None,