Skip to content

Commit db1dd62

Browse files
committed
Convert class variables to instance variables.
1 parent 4e8d84b commit db1dd62

File tree

3 files changed

+25
-35
lines changed

3 files changed

+25
-35
lines changed

src/main/resources/scripts/lib/envconfig.py

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ def __init__(self, field_key, value):
2323

2424

2525
class PropConfig:
26-
__properties = {}
27-
2826
def __init__(self, property_file_path_list):
27+
self.__properties = {}
2928
if not property_file_path_list:
3029
return
3130

@@ -53,19 +52,16 @@ def set_property(self, key, value):
5352
self.__properties[key] = value
5453

5554
class EnvConfig:
56-
__config_file_path = None
57-
__config_json = None
58-
__properties = None
59-
60-
__missing_vars = False
61-
__file_updated = False
62-
__migrated = False
63-
64-
__origin_json_str = None
65-
66-
__unconfigured_fields = []
67-
6855
def __init__(self, config_file_path, properties, secrets):
56+
self.__config_file_path = None
57+
self.__config_json = None
58+
self.__properties = None
59+
self.__missing_vars = False
60+
self.__file_updated = False
61+
self.__migrated = False
62+
self.__origin_json_str = None
63+
self.__unconfigured_fields = []
64+
6965
self.__properties = properties
7066
self.__pespk_factory = PortableESPKFactory.newInstance()
7167

@@ -259,9 +255,6 @@ def is_empty():
259255
return self.__type == "empty"
260256

261257
class CertInfo:
262-
__alias = None
263-
__subject = None
264-
__not_after = None
265258
def __init__(self, alias, subject, not_after):
266259
self.__alias = alias
267260
self.__subject = subject
@@ -293,15 +286,12 @@ def expiration_in_days(self):
293286
return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS)
294287

295288
class CertConfig:
296-
__config_file_path = None
297-
__config_json = None
298-
__properties = None
299-
__migrated = False
300-
__origin_json_str = None
301-
__keystore = None
302-
303-
304289
def __init__(self, config_file_path, properties, secrets):
290+
self.__config_json = None
291+
self.__migrated = False
292+
self.__origin_json_str = None
293+
self.__keystore = None
294+
305295
self.__properties = properties
306296
self.__secrets = secrets
307297
self.__config_file_path = config_file_path

src/main/resources/scripts/lib/fedconfig.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
from java.security.cert import CertificateFactory
2222

2323
class FedConfigurator:
24-
__cert_config = None
25-
__simulation_mode = False
26-
27-
__update_cert_config = False
28-
__expiration_days = -1
29-
__base_dir = None
30-
3124
def __init__(self, pol_archive_path, env_archive_path, config_path, cert_config_path = None, properties = None, passphrase = "", confidentials=None):
25+
self.__cert_config = None
26+
self.__simulation_mode = False
27+
self.__update_cert_config = False
28+
self.__expiration_days = -1
29+
self.__base_dir = None
30+
3231
self.__passphrase_in = passphrase
3332
self.__pol_archive = PolicyArchive(pol_archive_path)
3433
self.__env_archive = EnvironmentArchive(env_archive_path)

src/main/resources/scripts/lib/secrets.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ class Secrets:
1717
"""
1818
__key_check = "axway-maven-plugin"
1919
__prefix_encrypt = "encrypt:"
20-
__file_path = None
21-
__secrets_json = {}
22-
__cipher = None
2320

2421
def __init__(self, secrets_key_file, secrets_file_path, create_if_not_exists=False):
22+
self.__file_path = None
23+
self.__secrets_json = {}
24+
self.__cipher = None
25+
2526
if not secrets_key_file:
2627
raise ValueError("No key file specified to encrypt/decrypt secrets!")
2728
if not secrets_file_path:

0 commit comments

Comments
 (0)