Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Do Not Install the MySQL2 Gem in the OMSAgent Installation
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiezhang committed Oct 26, 2016
1 parent 96c805f commit eaace5d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions build/buildRuby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ if [ $RUNNING_FOR_TEST -eq 0 ]; then

# Pacify Make (Make doesn't know that the generated Ruby directory can vary)
mkdir -p ${BASE_DIR}/intermediate/${BUILD_CONFIGURATION}/ruby
else
echo "Installing MySQL gem into Test Ruby under: ${RUBY_DESTDIR} ..."
elevate ${RUBY_DESTDIR}/bin/gem install mysql2

This comment has been minimized.

Copy link
@NarineM

NarineM Oct 26, 2016

Contributor

This one is part of test ruby. if you remove the plugin from test ruby, MySQL plugin tests will fail.

This comment has been minimized.

Copy link
@NarineM

NarineM Oct 26, 2016

Contributor

You need to leave this part as it was unless you remove the entire plugin

This comment has been minimized.

Copy link
@robbiezhang

robbiezhang Oct 26, 2016

Author Member

I didn't get any error running all tests. can you double check?

This comment has been minimized.

Copy link
@NarineM

NarineM Oct 26, 2016

Contributor

This part is only used to install mysql2 gem into test ruby (not production ruby). Either test ruby stays as it was or the mysql2 fluentd plugin tests need to be also removed.

This comment has been minimized.

Copy link
@NarineM

NarineM Oct 26, 2016

Contributor

Are the plugin test running at all?
If they run, MySQL plugin test should fail. May be they are not running?

This comment has been minimized.

Copy link
@NarineM

NarineM Oct 26, 2016

Contributor

Just remembered that this plugin unittests are using a mock interface. But we should leave the gem be installed under test ruby until we decide to remove it completely. That was what helped us to discover ruby SSL and certs issue .

fi

exit 0
12 changes: 0 additions & 12 deletions installer/bundle/bundle_skel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -841,18 +841,6 @@ case "$installMode" in
echo "----- No base kits to update -----"
fi

# These steps are required to fix mysql2 gem compatibility issue on latest Ubuntu distros and can be removed after any release >2016_v1.2.0-75
if ${OMS_RUBY_DIR}/gem list | grep -q "mysql2" ; then
# Cleans up static mysql2 ruby gem if it exists in omsagent ruby path
echo "Removing MySQL2 ruby gem."
${OMS_RUBY_DIR}/gem uninstall mysql2 2>/dev/null
fi
echo "----- Installing MySQL2 ruby gem -----"
if ! ${OMS_RUBY_DIR}/gem install mysql2; then
echo "MySQL2 ruby gem was not installed. MySQL ruby fluentd plugin would be disabled."
echo "Fix the dependencies and run '${OMS_RUBY_DIR}/ruby/bin/gem install mysql2' after omsagent installation to enable MySQL plugin."
fi

if [ $KIT_STATUS -eq 0 ]; then
# These conditionals exist due to some upgrade bugs in the postuninstall scripts of previous kits. These can be removed after GA.
if [ -d /opt/microsoft/omsconfig ]; then
Expand Down
12 changes: 0 additions & 12 deletions installer/datafiles/base_omsagent.data
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,6 @@ fi
# The real conf directory has to be owned by omsagent to be readable by the omsagent daemon
chown -R omsagent:omsagent ${{CONF_DIR}}

# Should run before onboarding script(Postinstall_300) and enabling OMS service(%Postinstall_500)
%Postinstall_290
if ${{OMSHOME}}/ruby/bin/gem list | grep -q "mysql2" ; then
echo "Skipping MySQL2 ruby gem installation since it is already installed."
else
echo "----- Installing MySQL ruby gem -----"
if ! ${{OMSHOME}}/ruby/bin/gem install mysql2; then
echo "MySQL2 ruby gem was not installed. MySQL ruby plugin would be disabled."
echo "Fix the dependencies and run '${OMS_RUBY_DIR}/ruby/bin/gem install mysql2' after omsagent installation to enable MySQL plugin."
fi
fi

%Postinstall_300
if [ -f /etc/omsagent-onboard.conf ]; then
/opt/microsoft/omsagent/bin/omsadmin.sh
Expand Down

0 comments on commit eaace5d

Please sign in to comment.