Revert "Full Juju Charm support"
[osm/SO.git] / rwlaunchpad / plugins / vala / rwos_ma_nfvo / rwos_ma_nfvo_rest / rwos_ma_nfvo_rest.py
1
2 #
3 # Copyright 2016 RIFT.IO Inc
4 #
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
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
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.
16 #
17
18 import re
19 import logging
20 import rw_status
21 import rwlogger
22 import subprocess, os
23
24 import gi
25 gi.require_version('RwOsMaNfvo', '1.0')
26 gi.require_version('RwTypes', '1.0')
27 from gi.repository import (
28 GObject,
29 RwOsMaNfvo,
30 RwTypes)
31
32 logger = logging.getLogger('rwos-ma-nfvo-rest')
33
34
35 rwstatus = rw_status.rwstatus_from_exc_map({ IndexError: RwTypes.RwStatus.NOTFOUND,
36 KeyError: RwTypes.RwStatus.NOTFOUND,
37 NotImplementedError: RwTypes.RwStatus.NOT_IMPLEMENTED,})
38
39 class RwOsMaNfvoRestPlugin(GObject.Object, RwOsMaNfvo.Orchestrator):
40 """This class implements the Ve-Vnfm VALA methods."""
41
42 def __init__(self):
43 GObject.Object.__init__(self)
44
45
46 @rwstatus
47 def do_init(self, rwlog_ctx):
48 if not any(isinstance(h, rwlogger.RwLogger) for h in logger.handlers):
49 logger.addHandler(rwlogger.RwLogger(subcategory="rwos-ma-nfvo-rest",
50 log_hdl=rwlog_ctx,))
51