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.core.hookenv import action_fail
23
from neutron_api_utils import (
31
"""Pause the Ceilometer services.
32
@raises Exception should the service fail to stop.
34
pause_unit_helper(register_configs())
38
"""Resume the Ceilometer services.
39
@raises Exception should the service fail to start."""
40
resume_unit_helper(register_configs())
43
# A dictionary of all the defined actions to callables (which take
45
ACTIONS = {"pause": pause, "resume": resume}
49
action_name = os.path.basename(args[0])
51
action = ACTIONS[action_name]
53
return "Action %s undefined" % action_name
57
except Exception as e:
61
if __name__ == "__main__":
62
sys.exit(main(sys.argv))