From 5fadd0de573e2e6d40db1b501b84afccfc39aba7 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Thu, 7 Nov 2024 20:12:59 +0000 Subject: [PATCH] [pre-commit] Fix execute and shebang lines This commit removes the execute bit from several files and remove the shebang lines from the devstack plugin. While the devstack plugin is written in bash, it is not an executable script. The devstack plugin is sourced by devstack as needed, as such it is not executed in a subshell and the #!/bin/bash lines are not used even when present. Change-Id: I82ca22b7a47bf267fe6cf11f3e3519510108c146 --- .pre-commit-config.yaml | 6 ++---- devstack/lib/watcher | 2 -- devstack/plugin.sh | 2 -- devstack/upgrade/from_rocky/upgrade-watcher | 2 -- watcher/applier/default.py | 0 watcher/common/clients.py | 0 watcher/conf/__init__.py | 0 watcher/conf/ironic_client.py | 0 watcher/conf/nova_client.py | 0 watcher/decision_engine/strategy/strategies/base.py | 0 .../applier/action_plan/test_default_action_handler.py | 0 watcher/tests/common/test_clients.py | 0 watcher/tests/conf/test_list_opts.py | 0 .../strategy/strategies/test_host_maintenance.py | 0 14 files changed, 2 insertions(+), 10 deletions(-) mode change 100755 => 100644 watcher/applier/default.py mode change 100755 => 100644 watcher/common/clients.py mode change 100755 => 100644 watcher/conf/__init__.py mode change 100755 => 100644 watcher/conf/ironic_client.py mode change 100755 => 100644 watcher/conf/nova_client.py mode change 100755 => 100644 watcher/decision_engine/strategy/strategies/base.py mode change 100755 => 100644 watcher/tests/applier/action_plan/test_default_action_handler.py mode change 100755 => 100644 watcher/tests/common/test_clients.py mode change 100755 => 100644 watcher/tests/conf/test_list_opts.py mode change 100755 => 100644 watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 99e971703..166ba5b3a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,10 +16,8 @@ repos: files: .*\.json$ - id: check-yaml files: .*\.(yaml|yml)$ - # FIXME(sean-k-mooney): we currently have some files - # with incorrect permission, resolve this in a follow up - # - id: check-executables-have-shebangs - # - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable # git - id: check-added-large-files - id: check-case-conflict diff --git a/devstack/lib/watcher b/devstack/lib/watcher index ec1da4f45..2ced0968d 100644 --- a/devstack/lib/watcher +++ b/devstack/lib/watcher @@ -1,5 +1,3 @@ -#!/bin/bash -# # lib/watcher # Functions to control the configuration and operation of the watcher services diff --git a/devstack/plugin.sh b/devstack/plugin.sh index b58b6949b..17d6c1780 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -1,5 +1,3 @@ -#!/bin/bash -# # plugin.sh - DevStack plugin script to install watcher # Save trace setting diff --git a/devstack/upgrade/from_rocky/upgrade-watcher b/devstack/upgrade/from_rocky/upgrade-watcher index 9757c3c68..bfa41ce6e 100644 --- a/devstack/upgrade/from_rocky/upgrade-watcher +++ b/devstack/upgrade/from_rocky/upgrade-watcher @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # ``upgrade-watcher`` function configure_watcher_upgrade { diff --git a/watcher/applier/default.py b/watcher/applier/default.py old mode 100755 new mode 100644 diff --git a/watcher/common/clients.py b/watcher/common/clients.py old mode 100755 new mode 100644 diff --git a/watcher/conf/__init__.py b/watcher/conf/__init__.py old mode 100755 new mode 100644 diff --git a/watcher/conf/ironic_client.py b/watcher/conf/ironic_client.py old mode 100755 new mode 100644 diff --git a/watcher/conf/nova_client.py b/watcher/conf/nova_client.py old mode 100755 new mode 100644 diff --git a/watcher/decision_engine/strategy/strategies/base.py b/watcher/decision_engine/strategy/strategies/base.py old mode 100755 new mode 100644 diff --git a/watcher/tests/applier/action_plan/test_default_action_handler.py b/watcher/tests/applier/action_plan/test_default_action_handler.py old mode 100755 new mode 100644 diff --git a/watcher/tests/common/test_clients.py b/watcher/tests/common/test_clients.py old mode 100755 new mode 100644 diff --git a/watcher/tests/conf/test_list_opts.py b/watcher/tests/conf/test_list_opts.py old mode 100755 new mode 100644 diff --git a/watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py b/watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py old mode 100755 new mode 100644