Skip to content

Commit e49d771

Browse files
Merge branch 'master' into feature/ssh
2 parents 7ceb756 + 5d8b1ba commit e49d771

7 files changed

Lines changed: 40 additions & 1 deletion

File tree

juju/model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,12 @@ def make_archive(self, path):
21922192
relative_path = dirpath[len(self.path) + 1:]
21932193
if relative_path and not self._ignore(relative_path):
21942194
zf.write(dirpath, relative_path)
2195+
for dirname in dirnames:
2196+
archive_name = os.path.join(relative_path, dirname)
2197+
real_path = os.path.join(dirpath, dirname)
2198+
if os.path.islink(real_path):
2199+
self._check_link(real_path)
2200+
self._write_symlink(zf, os.readlink(real_path), archive_name)
21952201
for name in filenames:
21962202
archive_name = os.path.join(relative_path, name)
21972203
if not self._ignore(archive_name):
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -eux
3+
./lib/module/hello.sh
4+
status-set active
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../mod/module
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: simple
2+
summary: A simple example charm with the new operator framework
3+
description: |
4+
Simple is an example charm
5+
series:
6+
- xenial
7+
- bionic
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
echo "Hello World"

tests/integration/test_model.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ async def test_deploy_bundle(event_loop):
9393
assert app in model.applications
9494

9595

96+
@base.bootstrapped
97+
@pytest.mark.asyncio
98+
async def test_deploy_local_charm_folder_symlink(event_loop):
99+
from pathlib import Path
100+
tests_dir = Path(__file__).absolute().parent.parent
101+
charm_path = tests_dir / 'charm-folder-symlink'
102+
103+
async with base.CleanModel() as model:
104+
simple = await model.deploy(str(charm_path))
105+
assert 'simple' in model.applications
106+
terminal_statuses = ('active', 'error', 'blocked')
107+
await model.block_until(
108+
lambda: (
109+
len(simple.units) > 0 and
110+
simple.units[0].workload_status in terminal_statuses)
111+
)
112+
assert simple.units[0].workload_status == 'active'
113+
114+
96115
@base.bootstrapped
97116
@pytest.mark.asyncio
98117
async def test_deploy_trusted_bundle(event_loop):

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ commands =
4242
[testenv:lint]
4343
envdir = {toxworkdir}/py3
4444
commands =
45-
flake8 --ignore E501,W504 {posargs} juju tests examples
45+
flake8 --ignore E501,W504,E402 {posargs} juju tests examples
4646
deps =
4747
flake8
4848

0 commit comments

Comments
 (0)