Skip to content

Commit

Permalink
Fixes #11430: Plugin postint are not run after a rudder upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
peckpeck committed Sep 26, 2017
1 parent 975fef8 commit 29160a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rudder-server-relay/SOURCES/rudder-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Usage:
rudder-pkg install-file <package.rpkg>
rudder-pkg list
rudder-pkg remove <package>
rudder-pkg rudder-postupgrade
rudder-pkg plugin save-status
rudder-pkg plugin restore-status
rudder-pkg plugin enable <plugin>
Expand Down Expand Up @@ -317,6 +318,12 @@ def plugin_restore_status():
check_compatibility()


def rudder_postupgrade()
for package in DB["plugins"]:
script_dir = DB_DIRECTORY + "/" + package_name
run_script("postinst", script_dir, True)


def plugin_status(plugin, status):
if plugin not in DB["plugins"]:
fail("Unknown plugin " + plugin)
Expand All @@ -337,6 +344,8 @@ if __name__ == "__main__":
package_list()
elif args['remove']:
remove(args['<package>'])
elif args['rudder-postupgrade']:
rudder_postupgrade()
elif args['plugin']:
if args['save-status']:
plugin_save_status()
Expand Down
9 changes: 9 additions & 0 deletions rudder-webapp/SOURCES/rudder-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,13 @@ upgrade_inventory() {

}

################################################################################
# Check and upgrade plugins
################################################################################
upgrade_plugins() {
/opt/rudder/bin/rudder-pkg rudder-postupgrade
}

################################################################################
# Migration function calls
################################################################################
Expand Down Expand Up @@ -767,6 +774,8 @@ if ${RUDDER_LDAP_INITIALIZED}; then
fi
fi

upgrade_plugins

################################################################################
# End
################################################################################
Expand Down

0 comments on commit 29160a3

Please sign in to comment.