Ensure python scripts are py3 compatible

This patch set is one of many to migrate existing code/script to be
python-3 compatible as python-2 is sunsetting in January of 2020.

Change-Id: I337069203a3273e9aba6a37294ee3c25e5b4870a
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2019-10-10 08:55:40 -05:00
parent 34aed6f20c
commit 938a1deb03
2 changed files with 17 additions and 18 deletions

View File

@ -82,11 +82,8 @@ def update_secret(name, secret):
def read_from_files():
keys = filter(
lambda name: os.path.isfile(FERNET_DIR + name) and re.match("^\d+$",
name),
os.listdir(FERNET_DIR)
)
keys = [name for name in os.listdir(FERNET_DIR) if os.path.isfile(FERNET_DIR + name)
and re.match("^\d+$", name)]
data = {}
for key in keys:
with open(FERNET_DIR + key, 'r') as f:

View File

@ -1,18 +1,20 @@
#!/usr/bin/env python
# Copyright 2019 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{/*
Copyright 2019 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
"""
Health probe script for OpenStack agents that uses RPC/unix domain socket for