3
# Copyright 2016 Canonical Ltd
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
# you may not use this file except in compliance with the License.
7
# You may obtain a copy of the License at
9
# http://www.apache.org/licenses/LICENSE-2.0
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
20
sys.path.append('hooks/')
22
from charmhelpers.contrib.openstack.utils import (
23
git_install_requested,
26
from charmhelpers.core.hookenv import (
32
from neutron_api_utils import (
36
from neutron_api_hooks import (
42
"""Reinstall from source and restart services.
44
If the openstack-origin-git config option was used to install openstack
45
from source git repositories, then this action can be used to reinstall
46
from updated git repositories, followed by a restart of services."""
47
if not git_install_requested():
48
action_fail('openstack-origin-git is not configured')
52
git_install(config('openstack-origin-git'))
55
action_set({'traceback': traceback.format_exc()})
56
action_fail('git-reinstall resulted in an unexpected error')
59
if __name__ == '__main__':