Skip to content

Commit 342cb9c

Browse files
authored
Merge branch 'develop' into guest-config
2 parents b1dd761 + 23be951 commit 342cb9c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests_e2e/orchestrator/scripts/install-agent

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ if [ $started == false ]; then
101101
exit 1
102102
fi
103103

104-
#
105-
# Install the package
106-
#
107-
echo "========== Installing Agent =========="
108-
echo "Installing $package as version $version..."
109-
unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version"
110104

111105
python=$(get-agent-python)
112106
# Ensure that AutoUpdate is enabled. some distros, e.g. Flatcar have a waagent.conf in different path
@@ -162,14 +156,21 @@ if [[ $(uname -a) == *"flatcar"* ]]; then
162156
fi
163157

164158
#
165-
# Restart the service
159+
# Install the package
166160
#
167-
echo "Restarting service..."
161+
echo "========== Installing Agent =========="
162+
168163
agent-service stop
169164

170165
# Rename the previous log to ensure the new log starts with the agent we just installed
171166
mv /var/log/waagent.log /var/log/waagent."$(date --iso-8601=seconds)".log
172167

168+
echo "Cleaning up the existing agents"
169+
rm -rfv /var/lib/waagent/WALinuxAgent-*
170+
171+
echo "Installing $package as version $version..."
172+
unzip.py "$package" "/var/lib/waagent/WALinuxAgent-$version"
173+
173174
agent-service start
174175

175176
#

0 commit comments

Comments
 (0)