Skip to content

Commit a6322f0

Browse files
authored
chore: update c7n-left to 0.3.3 min (#33)
* chore: update c7n-left to 0.3.3 min * add dump command * black fmt
1 parent 86c9e3d commit a6322f0

File tree

5 files changed

+72
-16
lines changed

5 files changed

+72
-16
lines changed

poetry.lock

Lines changed: 46 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "stacklet.client.sinistral"
3-
version = "0.2.4"
3+
version = "0.2.5"
44
description = "Sinistral CLI"
55
authors = ["Sonny Shi <[email protected]>"]
66
maintainers = ["Stacklet <[email protected]>"]
@@ -20,7 +20,7 @@ jmespath = "^1.0.1"
2020
pyjwt = "^2.6.0"
2121
pyrsistent = "^0.19.3"
2222
pyyaml = "^6.0"
23-
c7n-left = "^0.3.0"
23+
c7n-left = "^0.3.3"
2424

2525

2626
[tool.poetry.group.dev.dependencies]

stacklet/client/sinistral/commands/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
from click.core import Group, Command, Option
44

5+
from .dump import dump
56
from .run import run
67

78
import stacklet.client.sinistral.commands.policy # noqa
@@ -16,7 +17,7 @@
1617
from stacklet.client.sinistral.utils import global_options
1718

1819

19-
commands = [run]
20+
commands = [run, dump]
2021

2122

2223
# Instantiate commands out of clients
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright Stacklet, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
import sys
4+
5+
import click
6+
7+
from c7n_left.cli import dump as left_dump
8+
9+
10+
class LeftWrapper(click.core.Command):
11+
def make_parser(self, ctx):
12+
for param in left_dump.params:
13+
self.params.append(param)
14+
return super().make_parser(ctx)
15+
16+
17+
@click.command(name="dump", cls=LeftWrapper)
18+
@click.pass_context
19+
def dump(ctx, *args, **kwargs):
20+
"""Dump the IaC resource graph and input variables"""
21+
sys.exit(left_dump.invoke(ctx))

tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def test_commands_present():
2828
assert "login" in result.output
2929
assert "configure" in result.output
3030
assert "show" in result.output
31+
assert "dump" in result.output
3132

3233

3334
def test_cli_show():

0 commit comments

Comments
 (0)