Merge branch 'v8.0' 15/9915/2
authorbeierlm <mark.beierl@canonical.com>
Fri, 23 Oct 2020 18:54:56 +0000 (14:54 -0400)
committerbeierlm <mark.beierl@canonical.com>
Fri, 23 Oct 2020 19:01:05 +0000 (15:01 -0400)
Change-Id: I96d3bae3abca7b2a5f66bca591b4358d6c921f3d
Signed-off-by: beierlm <mark.beierl@canonical.com>
installers/charm/lcm-k8s/reactive/lcm.py
installers/charm/ng-ui/hooks/start [new symlink]
installers/charm/ng-ui/lib/ops [new symlink]
installers/charm/ng-ui/src/charm.py
installers/charm/pla/hooks/install [new symlink]
installers/charm/pla/hooks/start [new symlink]
installers/charm/pla/hooks/upgrade-charm [new symlink]
installers/charm/pla/lib/ops [new symlink]
installers/charm/pla/src/charm.py
installers/charmed_install.sh

index 313ed63..1cb4661 100644 (file)
 #     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 #     See the License for the specific language governing permissions and
 #     limitations under the License.
-from charms.layer.caas_base import pod_spec_set
-from charms.reactive import endpoint_from_flag
-from charms.reactive import when, when_not, hook
-from charms.reactive.flags import set_flag, clear_flag
+import logging
+import yaml
+
 from charmhelpers.core.hookenv import (
     log,
     metadata,
     config,
 )
 from charms import layer
-import yaml
-import logging
+from charms.layer.caas_base import pod_spec_set
+from charms.reactive import endpoint_from_flag
+from charms.reactive import when, when_not, hook
+from charms.reactive.flags import set_flag, clear_flag
+
 
 logger = logging.getLogger(__name__)
 
diff --git a/installers/charm/ng-ui/hooks/start b/installers/charm/ng-ui/hooks/start
new file mode 120000 (symlink)
index 0000000..25b1f68
--- /dev/null
@@ -0,0 +1 @@
+../src/charm.py
\ No newline at end of file
diff --git a/installers/charm/ng-ui/lib/ops b/installers/charm/ng-ui/lib/ops
new file mode 120000 (symlink)
index 0000000..d934193
--- /dev/null
@@ -0,0 +1 @@
+../mod/operator/ops
\ No newline at end of file
index 8e21bcd..d9ad8f2 100755 (executable)
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-import sys
-import logging
 import base64
-
-sys.path.append("lib")
+from glob import glob
+import logging
+from pathlib import Path
+from string import Template
+import sys
 
 from ops.charm import CharmBase
 from ops.framework import StoredState, Object
@@ -30,9 +31,9 @@ from ops.model import (
     WaitingStatus,
 )
 
-from glob import glob
-from pathlib import Path
-from string import Template
+
+sys.path.append("lib")
+
 
 logger = logging.getLogger(__name__)
 
@@ -158,6 +159,8 @@ class NGUICharm(CharmBase):
                 }
             )
 
+        logger.debug(files)
+
         spec = {
             "version": 2,
             "containers": [
diff --git a/installers/charm/pla/hooks/install b/installers/charm/pla/hooks/install
new file mode 120000 (symlink)
index 0000000..25b1f68
--- /dev/null
@@ -0,0 +1 @@
+../src/charm.py
\ No newline at end of file
diff --git a/installers/charm/pla/hooks/start b/installers/charm/pla/hooks/start
new file mode 120000 (symlink)
index 0000000..25b1f68
--- /dev/null
@@ -0,0 +1 @@
+../src/charm.py
\ No newline at end of file
diff --git a/installers/charm/pla/hooks/upgrade-charm b/installers/charm/pla/hooks/upgrade-charm
new file mode 120000 (symlink)
index 0000000..25b1f68
--- /dev/null
@@ -0,0 +1 @@
+../src/charm.py
\ No newline at end of file
diff --git a/installers/charm/pla/lib/ops b/installers/charm/pla/lib/ops
new file mode 120000 (symlink)
index 0000000..d934193
--- /dev/null
@@ -0,0 +1 @@
+../mod/operator/ops
\ No newline at end of file
index e137394..785766d 100755 (executable)
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-import sys
+from glob import glob
 import logging
-
-sys.path.append("lib")
+from pathlib import Path
+from string import Template
+import sys
 
 from ops.charm import CharmBase
 from ops.framework import StoredState, Object
@@ -27,9 +28,9 @@ from ops.model import (
     WaitingStatus,
 )
 
-from glob import glob
-from pathlib import Path
-from string import Template
+
+sys.path.append("lib")
+
 
 logger = logging.getLogger(__name__)
 
@@ -84,7 +85,7 @@ class PLACharm(CharmBase):
         config = self.framework.model.config
 
         ports = [
-            {"name": "port", "containerPort": config["port"], "protocol": "TCP",},
+            {"name": "port", "containerPort": config["port"], "protocol": "TCP", },
         ]
 
         config_spec = {
index d0418a8..f0f729e 100755 (executable)
@@ -261,7 +261,8 @@ function deploy_charmed_osm(){
 function check_osm_deployed() {
     TIME_TO_WAIT=600
     start_time="$(date -u +%s)"
-    total_service_count=14
+    total_service_count=15
+    previous_count=0
     while true
     do
         service_count=$(juju status | grep kubernetes | grep active | wc -l)
@@ -269,6 +270,10 @@ function check_osm_deployed() {
         if [ $service_count -eq $total_service_count ]; then
             break
         fi
+        if [ $service_count -ne $previous_count ]; then
+            previous_count=$service_count
+            start_time="$(date -u +%s)"
+        fi
         now="$(date -u +%s)"
         if [[ $(( now - start_time )) -gt $TIME_TO_WAIT ]];then
             echo "Timed out waiting for OSM services to become ready"
@@ -403,14 +408,16 @@ if [ -v MICROSTACK ]; then
     install_microstack
 fi
 
+OSM_HOSTNAME=$(juju config nbi-k8s juju-external-hostname):443
+
 echo "Your installation is now complete, follow these steps for configuring the osmclient:"
 echo
 echo "1. Create the OSM_HOSTNAME environment variable with the NBI IP"
 echo
-echo "export OSM_HOSTNAME=nbi.$API_SERVER.xip.io:443"
+echo "export OSM_HOSTNAME=$OSM_HOSTNAME"
 echo
 echo "2. Add the previous command to your .bashrc for other Shell sessions"
 echo
-echo "echo \"export OSM_HOSTNAME=nbi.$API_SERVER.xip.io:443\" >> ~/.bashrc"
+echo "echo \"export OSM_HOSTNAME=$OSM_HOSTNAME\" >> ~/.bashrc"
 echo
 echo "DONE"