From a806b1da9f65c965769903ad5691ec1449965ddd Mon Sep 17 00:00:00 2001 From: Hoai-Thu Vuong Date: Fri, 25 Mar 2022 12:40:06 +0700 Subject: [PATCH] fix(empty_string): #294 --- .pre-commit-config.yaml | 5 ++++- vmware_exporter/vmware_exporter.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ffe128..37e87b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,8 @@ repos: stages: [commit] - id: detect-aws-credentials stages: [commit] + args: + - --allow-missing-credentials # Generic file state - id: trailing-whitespace stages: [commit] @@ -45,6 +47,7 @@ repos: - id: dockerfilelint stages: [commit] - repo: https://github.com/mattlqx/pre-commit-sign - rev: v1.1.1 + rev: v1.1.3 hooks: - id: sign-commit + stages: [commit-msg] diff --git a/vmware_exporter/vmware_exporter.py b/vmware_exporter/vmware_exporter.py index adca198..e497fa2 100755 --- a/vmware_exporter/vmware_exporter.py +++ b/vmware_exporter/vmware_exporter.py @@ -1094,7 +1094,7 @@ def vm_labels(self): if 'summary.config.vmPathName' in row: p = row['summary.config.vmPathName'] - if p[0] == '[': + if p.startswith('['): p = p[1:p.find("]")] else: p = 'n/a'