GoogleCloudPlatform / gcpdiag

gcpdiag is a command-line diagnostics tool for GCP customers.
https://gcpdiag.dev/
Apache License 2.0
288 stars 67 forks source link

Fix os version detection on err_2022_002_image_versions #26

Closed DKbyo closed 2 years ago

DKbyo commented 2 years ago

This PR fix the following issue

Traceback (most recent call last):
  File "/gcpdiag/bin/gcpdiag", line 64, in <module>
    main(sys.argv)
  File "/gcpdiag/bin/gcpdiag", line 42, in main
    lint_command.run(argv)
  File "/gcpdiag/gcpdiag/lint/command.py", line 267, in run
    exit_code = repo.run_rules(context, report, include_patterns,
  File "/gcpdiag/gcpdiag/lint/__init__.py", line 430, in run_rules
    rule.run_rule_f(context, rule_report)
  File "/gcpdiag/gcpdiag/lint/dataproc/err_2022_002_image_versions.py", line 96, in run_rule
    if ImageVersion(cluster.image_version).is_deprecated():
  File "/gcpdiag/gcpdiag/lint/dataproc/err_2022_002_image_versions.py", line 78, in is_deprecated
    if self.version.os == 'debian' and self.os_ver < 10:
AttributeError: 'ImageVersion' object has no attribute 'os_ver'
dawidmalina commented 2 years ago

Thanks @DKbyo for the contribution.