X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fcharm%2Fosm-ro%2Fsrc%2Fcharm.py;h=0c5ab9a357c2027c0429f0598762e240435b6c58;hb=230f564de508f1820e40d0bab100763954255595;hp=8b45191448f35f563280737348daef1fc0202e13;hpb=ffab0f160cc41788046aa1320f0c4f37ad60f32e;p=osm%2Fdevops.git diff --git a/installers/charm/osm-ro/src/charm.py b/installers/charm/osm-ro/src/charm.py index 8b451914..0c5ab9a3 100755 --- a/installers/charm/osm-ro/src/charm.py +++ b/installers/charm/osm-ro/src/charm.py @@ -49,10 +49,29 @@ from ops.model import ActiveStatus, Container from legacy_interfaces import MongoClient +ro_host_paths = { + "NG-RO": "/usr/lib/python3/dist-packages/osm_ng_ro", + "RO-plugin": "/usr/lib/python3/dist-packages/osm_ro_plugin", + "RO-SDN-arista_cloudvision": "/usr/lib/python3/dist-packages/osm_rosdn_arista_cloudvision", + "RO-SDN-dpb": "/usr/lib/python3/dist-packages/osm_rosdn_dpb", + "RO-SDN-dynpac": "/usr/lib/python3/dist-packages/osm_rosdn_dynpac", + "RO-SDN-floodlight_openflow": "/usr/lib/python3/dist-packages/osm_rosdn_floodlightof", + "RO-SDN-ietfl2vpn": "/usr/lib/python3/dist-packages/osm_rosdn_ietfl2vpn", + "RO-SDN-juniper_contrail": "/usr/lib/python3/dist-packages/osm_rosdn_juniper_contrail", + "RO-SDN-odl_openflow": "/usr/lib/python3/dist-packages/osm_rosdn_odlof", + "RO-SDN-onos_vpls": "/usr/lib/python3/dist-packages/osm_rosdn_onos_vpls", + "RO-VIM-aws": "/usr/lib/python3/dist-packages/osm_rovim_aws", + "RO-VIM-azure": "/usr/lib/python3/dist-packages/osm_rovim_azure", + "RO-VIM-gcp": "/usr/lib/python3/dist-packages/osm_rovim_gcp", + "RO-VIM-openstack": "/usr/lib/python3/dist-packages/osm_rovim_openstack", + "RO-VIM-openvim": "/usr/lib/python3/dist-packages/osm_rovim_openvim", + "RO-VIM-vmware": "/usr/lib/python3/dist-packages/osm_rovim_vmware", +} HOSTPATHS = [ HostPath( config="ro-hostpath", - container_path="/usr/lib/python3/dist-packages/osm_ro", + container_path="/usr/lib/python3/dist-packages/", + submodules=ro_host_paths, ), HostPath( config="common-hostpath", @@ -102,7 +121,8 @@ class OsmRoCharm(CharmBase): check_container_ready(self.container) self._configure_certificates() - self._configure_service() + if not self.debug_mode.started: + self._configure_service() self._update_ro_relation() # Update charm status @@ -203,6 +223,12 @@ class OsmRoCharm(CharmBase): ]: raise CharmError("invalid value for log-level option") + refresh_period = self.config.get("period_refresh_active") + if refresh_period and refresh_period < 60 and refresh_period != -1: + raise ValueError( + "Refresh Period is too tight, insert >= 60 seconds or disable using -1" + ) + def _check_relations(self) -> None: """Validate charm relations. @@ -290,6 +316,8 @@ class OsmRoCharm(CharmBase): "OSMRO_STORAGE_PATH": "/app/storage", "OSMRO_STORAGE_COLLECTION": "files", "OSMRO_STORAGE_URI": self.mongodb_client.connection_string, + "OSMRO_PERIOD_REFRESH_ACTIVE": self.config.get("period_refresh_active") + or 60, }, } },