Skip to content

Commit 5c692f7

Browse files
committed
Updated shebang
1 parent 1452d8b commit 5c692f7

File tree

9 files changed

+16
-18
lines changed

9 files changed

+16
-18
lines changed

roles/aviconfig/tasks/upgradeprofile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
api_context: "{{ avi_api_context | default(omit) }}"
1515
avi_api_update_method: "{{ item.avi_api_update_method | default(omit) }}"
1616
avi_api_patch_op: "{{ item.avi_api_patch_op | default(omit) }}"
17-
controller: "{{ item.controller | default(omit) }}"
1817
dry_run: "{{ item.dry_run | default(omit) }}"
1918
image: "{{ item.image | default(omit) }}"
2019
pre_checks: "{{ item.pre_checks | default(omit) }}"

roles/aviconfig/tasks/upgradeprofile_delete.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
state: "{{ avi_role_state_mode }}"
1515
avi_api_update_method: "{{ item.avi_api_update_method | default(omit) }}"
1616
avi_api_patch_op: "{{ item.avi_api_patch_op | default(omit) }}"
17-
controller: "{{ item.controller | default(omit) }}"
1817
dry_run: "{{ item.dry_run | default(omit) }}"
1918
image: "{{ item.image | default(omit) }}"
2019
pre_checks: "{{ item.pre_checks | default(omit) }}"

roles/avise/files/systemd/avi_host_server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
############################################################################
23
# ========================================================================
34
# Copyright 2024 VMware, Inc. All rights reserved. VMware Confidential
@@ -50,7 +51,7 @@
5051
logger = logging.getLogger()
5152
logger.setLevel(logging.DEBUG)
5253
# 20MB file limit for logging
53-
handler = RotatingFileHandler(log_file, maxBytes=20*1024*1024, backupCount=1)
54+
handler = RotatingFileHandler(log_file, maxBytes=20 * 1024 * 1024, backupCount=1)
5455
formatter = logging.Formatter("%(asctime)s - %(message)s")
5556
handler.setFormatter(formatter)
5657
logger.addHandler(handler)
@@ -116,7 +117,7 @@ def create_uds_socket():
116117
logger.error(
117118
"Failed to unlink domain stream socket: %s", exception)
118119
raise Exception(
119-
"Failed to unlink domain stream socket: %s", exception)
120+
"Failed to unlink domain stream socket: {}".format(exception))
120121

121122
# Create a UDS socket
122123
try:
@@ -126,7 +127,7 @@ def create_uds_socket():
126127
sock.listen(1)
127128
logger.info("Listening on %s", SERVER_ADDRESS)
128129
return sock
129-
except:
130+
except Exception as ex:
130131
exception = traceback.format_exc()
131132
logger.error("socket listen failed: %s", exception)
132133
raise Exception("socket listen failed: {}".format(exception))

roles/avise/files/systemd/avihost_service_script.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -x
1+
#!/bin/sh
22
############################################################################
33
# ========================================================================
44
# Copyright 2024 VMware, Inc. All rights reserved. VMware Confidential
@@ -7,7 +7,7 @@
77

88
start()
99
{
10-
if [[ -f /opt/avitest_python_version ]]; then
10+
if [ -f /opt/avitest_python_version ]; then
1111
# For testing against python2 and python3
1212
version=$(cat /opt/avitest_python_version)
1313
else
@@ -18,8 +18,8 @@ start()
1818
command -v python3 >/dev/null 2>&1 && version='3'
1919
fi
2020

21-
if [[ $version != '0' ]]; then
22-
exec python$version /usr/sbin/avi_host_server.py
21+
if [ "$version" != '0' ]; then
22+
exec python"$version" /usr/sbin/avi_host_server.py
2323
else
2424
echo "Unable to find any installed python"
2525
exit 1

roles/avise/files/systemd/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python
22
############################################################################
33
# ========================================================================
44
# Copyright 2024 VMware, Inc. All rights reserved. VMware Confidential
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
############################################################################
33
# ========================================================================
44
# Copyright 2024 VMware, Inc. All rights reserved. VMware Confidential
@@ -7,16 +7,16 @@
77

88
set -e
99
echo "Migrating avihost service files."
10-
major_version=`cat /bootstrap/VERSION | grep Version | awk '{print $2}' | awk '{split($0,a,".");}{print a[1]}'`
10+
major_version=$(cat /bootstrap/VERSION | grep Version | awk '{print $2}' | awk '{split($0,a,".");}{print a[1]}')
1111
BASEDIR=$(dirname "$0")
1212

1313
python_cmd='python3'
14-
if [ $major_version -lt 20 ]
14+
if [ "$major_version" -lt 20 ]
1515
then
1616
echo "using python2"
1717
python_cmd="python"
1818
fi
1919

20-
$python_cmd $BASEDIR/install.py
20+
"$python_cmd" "$BASEDIR"/install.py
2121

2222
echo "Completed: Migration of avihost service files."

roles/avise/tasks/docker/docker_checks.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,3 @@
119119
- name: Include error tasks if Docker disk size is insufficient
120120
ansible.builtin.include_tasks: error.yml
121121
when: docker_size_avail is defined and docker_size_avail|int < docker_size_req|int
122-
123-

roles/avise/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
# It was added to prevent mass "skipped" messages when deploying Avi.
66
- name: Avi SE | Deployment
77
include_tasks: docker/main.yml
8-

tests/sanity/ignore-2.15.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ plugins/modules/verify_se.py validate-modules:missing-gplv3-license
5959
roles/avicontroller/templates/avicontroller.j2 shebang
6060
roles/avise/templates/avise.j2 shebang
6161
roles/avise/templates/avise_service.j2 shebang
62+
roles/avise/files/systemd/avihost.service shebang
6263
molecule/default/files/avi_config.yml line-endings
6364
tests/unit/modules/test_avi_pool.py pylint!skip
6465
roles/avise/files/systemd/install.py pylint!skip
@@ -411,4 +412,5 @@ plugins/modules/avi_trustedhostprofile.py import-3.10!skip
411412
plugins/modules/avi_upgradeprofile.py import-3.10!skip
412413
plugins/modules/avi_tenantsystemconfiguration.py validate-modules:import-error
413414
plugins/modules/avi_tenantsystemconfiguration.py validate-modules:missing-gplv3-license
414-
plugins/modules/avi_bootstrap_controller.py validate-modules:no-default-for-required-parameter
415+
plugins/modules/avi_bootstrap_controller.py validate-modules:no-default-for-required-parameter
416+
plugins/modules/avi_csrfpolicy.py yamllint!skip

0 commit comments

Comments
 (0)