Commit 1e60e2ba9f
Unsigned
Layout: unified · split
applications/aws/aws_password_policy/evaluate_policy.py +3 −8
| @@ -151,16 +151,10 @@ def main() -> None: | |||
| 151 | result = evaluate(expected, actual, typ) | 151 | result = evaluate(expected, actual, typ) |
| 152 | 152 | ||
| 153 | # Normalise booleans for nicer CSV output | 153 | # Normalise booleans for nicer CSV output |
| 154 | actual_str = ( | 154 | actual_str = str(actual).lower() if isinstance(actual, bool) else str(actual) |
| 155 | str(actual).lower() | ||
| 156 | if isinstance(actual, bool) | ||
| 157 | else str(actual) | ||
| 158 | ) | ||
| 159 | expected_str = "" if expected is None else str(expected).lower() | 155 | expected_str = "" if expected is None else str(expected).lower() |
| 160 | 156 | ||
| 161 | csv_rows.append( | 157 | csv_rows.append([rule_no, friendly, expected_str, actual_str, result]) |
| 162 | [rule_no, friendly, expected_str, actual_str, result] | ||
| 163 | ) | ||
| 164 | 158 | ||
| 165 | # -------------------------------------------------------------- | 159 | # -------------------------------------------------------------- |
| 166 | # 3. Write the CSV file (timestamped) | 160 | # 3. Write the CSV file (timestamped) |
| @@ -180,4 +174,5 @@ def main() -> None: | |||
| 180 | 174 | ||
| 181 | if __name__ == "__main__": | 175 | if __name__ == "__main__": |
| 182 | import datetime # imported here to keep the top of file tidy | 176 | import datetime # imported here to keep the top of file tidy |
| 177 | |||
| 183 | main() | 178 | main() |