Skip to content

Commit

Permalink
Make pylama happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceaulinic committed May 13, 2020
1 parent ae20943 commit 3fcb4ef
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions napalm_logs/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,19 @@ def convert_env_dict(self, d):
if isinstance(v, list):
self.convert_env_list(v)

def convert_env_list(self, l):
for n, v in enumerate(l):
if isinstance(v, six.string_type):
if not v.startswith('${') or not v.endswith('}'):
def convert_env_list(self, lst):
for name, value in enumerate(lst):
if isinstance(value, six.string_type):
if not value.startswith('${') or not value.endswith('}'):
continue
if not os.environ.get(v[2:-1]):
log.error('No env variable found for %s, please check your config file', v[2:-1])
if not os.environ.get(value[2:-1]):
log.error('No env variable found for %s, please check your config file', value[2:-1])
sys.exit(1)
l[n] = os.environ[v[2:-1]]
if isinstance(v, dict):
self.convert_env_dict(v)
if isinstance(v, list):
self.convert_env_list(v)
lst[name] = os.environ[value[2:-1]]
if isinstance(value, dict):
self.convert_env_dict(value)
if isinstance(value, list):
self.convert_env_list(value)

def read_config_file(self, filepath):
config = {}
Expand Down

0 comments on commit 3fcb4ef

Please sign in to comment.