From: Adam Israel Date: Mon, 15 Oct 2018 17:12:07 +0000 (+0200) Subject: Merge "Relation support for multi-charm VNFs" X-Git-Tag: v5.0.0~6 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=95e2d7d8fd3798c521909164656bf568bf3bff85;hp=136186e189027698662452ee00a5e50ebe82384f Merge "Relation support for multi-charm VNFs" --- diff --git a/Makefile b/Makefile index 51e19b4..abc2c39 100644 --- 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 index 0000000..1d37c18 --- /dev/null +++ b/juju @@ -0,0 +1 @@ +modules/libjuju/juju \ No newline at end of file diff --git a/n2vc/vnf.py b/n2vc/vnf.py index 31e4877..a60f36c 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -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 # diff --git a/setup.py b/setup.py index 1450a15..b27dcbe 100644 --- a/setup.py +++ b/setup.py @@ -12,12 +12,12 @@ # 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 index 0000000..c07507b --- /dev/null +++ b/stdeb.cfg @@ -0,0 +1,5 @@ +[DEFAULT] +Suite: xenial +XS-Python-Version: >= 3.5 +Maintainer: Adam Israel +Depends: python3-pip