Skip to content

Commit a8ab4ca

Browse files
authored
Merge pull request #206 from Helene/fix_203
Fix code scanning alert
2 parents 30b0453 + 73152a5 commit a8ab4ca

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

source/confParser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def checkTLSsettings(args):
5050
args.get('tlsKeyPath'), args.get('tlsCertFile'))
5151
) or (not checkFileExists(
5252
args.get('tlsKeyPath'), args.get('tlsKeyFile'))):
53-
return False, MSG['CertError']
53+
return False, MSG['MissingFileFromPathError']
5454
return True, ''
5555

5656

@@ -62,7 +62,7 @@ def checkBasicAuthsettings(args):
6262
elif args.get('enabled') and ("/" in str(args.get('password')) and not
6363
os.path.isfile(args.get('password'))
6464
):
65-
return False, MSG['FileNotFound'].format(args.get('password'))
65+
return False, MSG['FileNotFound'].format("mandatory for basic auth")
6666
elif args.get('enabled') and "/" not in str(args.get('password')):
6767
try:
6868
base64.b64decode(args.get('password'), validate=True)
@@ -87,7 +87,7 @@ def checkAPIsettings(args):
8787

8888
def checkCAsettings(args):
8989
if args.get('caCertPath') and args['caCertPath'] != False and not (os.path.exists(args['caCertPath'])):
90-
return False, MSG['FileNotFound'].format(args.get('caCertPath'))
90+
return False, MSG['FileNotFound'].format("mandatory for CA validation")
9191
return True, ''
9292

9393

source/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'MissingPortParam': 'Missing applications port configuration, quitting',
3232
'MissingSSLCert': 'Missing ssl configuration, quitting',
3333
'KeyPathError': 'KeyPath directory not found, quitting',
34-
'CertError': 'Missing certificates in the specified keyPath directory, quitting',
34+
'MissingFileFromPathError': 'Missing certificates in the specified keyPath directory, quitting',
3535
'CollectorErr': 'Failed to initialize connection to pmcollector: {}, quitting',
3636
'MetaError': 'Metadata could not be retrieved. Check log file for more details, quitting',
3737
'MetaSuccess': 'Successfully retrieved MetaData',

source/zimonGrafanaIntf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ def main(argv):
226226
logger.info("%s", MSG['BridgeVersionInfo'].format(__version__))
227227
logger.details('zimonGrafanaItf invoked with parameters:\n %s',
228228
"\n".join("{}={}".format(k, v)
229-
for k, v in args.items() if not
230-
k == 'apiKeyValue'))
229+
for k, v in args.items() if
230+
k not in ['apiKeyValue', 'password']))
231231
mdHandler = MetadataHandler(logger=logger, server=args.get('server'),
232232
port=args.get('serverPort'),
233233
apiKeyName=args.get('apiKeyName'),

0 commit comments

Comments
 (0)