diff --git a/pyproject.toml b/pyproject.toml index cf7053f..131dc54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wgnetns" -version = "2.3.0" +version = "2.3.1" description = "wg-quick for network namespaces" authors = ["dadevel "] license = "MIT" diff --git a/wgnetns/main.py b/wgnetns/main.py index 74f34a4..e847112 100755 --- a/wgnetns/main.py +++ b/wgnetns/main.py @@ -90,6 +90,8 @@ def cli(args): namespace.teardown(check=not opts.force) elif opts.action == 'list': output = ip('-json', 'netns', capture=True) + if not output: + return data = json.loads(output) print('\n'.join(item['name'] for item in data)) elif opts.action == 'switch':