32 |
32 |
33 |
33 |
34 def checkSshNoHostKeyVerification(reportError, context, config): |
34 def checkSshNoHostKeyVerification(reportError, context, config): |
35 """ |
35 """ |
36 Function to check for use of mako templates. |
36 Function to check for use of mako templates. |
37 |
37 |
38 @param reportError function to be used to report errors |
38 @param reportError function to be used to report errors |
39 @type func |
39 @type func |
40 @param context security context object |
40 @param context security context object |
41 @type SecurityContext |
41 @type SecurityContext |
42 @param config dictionary with configuration data |
42 @param config dictionary with configuration data |
43 @type dict |
43 @type dict |
44 """ |
44 """ |
45 if ( |
45 if ( |
46 context.isModuleImportedLike('paramiko') and |
46 context.isModuleImportedLike("paramiko") |
47 context.callFunctionName == 'set_missing_host_key_policy' and |
47 and context.callFunctionName == "set_missing_host_key_policy" |
48 context.callArgs and |
48 and context.callArgs |
49 context.callArgs[0] in ['AutoAddPolicy', 'WarningPolicy'] |
49 and context.callArgs[0] in ["AutoAddPolicy", "WarningPolicy"] |
50 ): |
50 ): |
51 reportError( |
51 reportError( |
52 context.node.lineno - 1, |
52 context.node.lineno - 1, |
53 context.node.col_offset, |
53 context.node.col_offset, |
54 "S507", |
54 "S507", |