Merge "Relation support for multi-charm VNFs"
authorAdam Israel <adam.israel@canonical.com>
Mon, 15 Oct 2018 17:12:07 +0000 (19:12 +0200)
committerGerrit Code Review <root@osm.etsi.org>
Mon, 15 Oct 2018 17:12:07 +0000 (19:12 +0200)
Makefile
juju [new symlink]
n2vc/vnf.py
setup.py
stdeb.cfg [new file with mode: 0644]

index 51e19b4..abc2c39 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,3 +9,5 @@ test: lint
        tox
 lint:
        tox -e lint
+package:
+       python3 setup.py --command-packages=stdeb.command bdist_deb
diff --git a/juju b/juju
new file mode 120000 (symlink)
index 0000000..1d37c18
--- /dev/null
+++ b/juju
@@ -0,0 +1 @@
+modules/libjuju/juju
\ No newline at end of file
index 31e4877..a60f36c 100644 (file)
@@ -429,14 +429,23 @@ class N2VC:
         ########################################################
         to = ""
         if machine_spec.keys():
-            if all(k in machine_spec for k in ['host', 'user']):
-                # Enlist an existing machine as a Juju unit
-                machine = await model.add_machine(spec='ssh:{}@{}:{}'.format(
-                    machine_spec['user'],
-                    machine_spec['host'],
-                    self.GetPrivateKeyPath(),
-                ))
+            if all(k in machine_spec for k in ['hostname', 'username']):
+                # Get the path to the previously generated ssh private key.
+                # Machines we're manually provisioned must have N2VC's public
+                # key injected, so if we don't have a keypair, raise an error.
+                private_key_path = ""
+
+                # Enlist the existing machine in Juju
+                machine = await self.model.add_machine(
+                    spec='ssh:{}@{}:{}'.format(
+                        specs['host'],
+                        specs['user'],
+                        private_key_path,
+                    )
+                )
+                # Set the machine id that the deploy below will use.
                 to = machine.id
+            pass
 
         #######################################
         # Get the initial charm configuration #
index 1450a15..b27dcbe 100644 (file)
--- a/setup.py
+++ b/setup.py
 #     See the License for the specific language governing permissions and
 #     limitations under the License.
 
-from pathlib import Path
 from setuptools import setup, find_packages
 
 setup(
     name='N2VC',
-    version=0.1,
+    version_command=('git describe --match v* --tags --long --dirty',
+                     'pep440-git-full'),
     packages=find_packages(
         exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
     install_requires=[
@@ -29,8 +29,8 @@ setup(
         'paramiko',
     ],
     include_package_data=True,
-    maintainer='',
-    maintainer_email='',
+    maintainer='Adam Israel',
+    maintainer_email='adam.israel@canonical.com',
     description=(''),
     url='',
     license='Apache 2',
diff --git a/stdeb.cfg b/stdeb.cfg
new file mode 100644 (file)
index 0000000..c07507b
--- /dev/null
+++ b/stdeb.cfg
@@ -0,0 +1,5 @@
+[DEFAULT]
+Suite: xenial
+XS-Python-Version: >= 3.5
+Maintainer: Adam Israel <adam.israel@canonical.com>
+Depends: python3-pip