-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2020 Alexey Aksenov and individual contributors | ||
# See the LICENSE.txt file at the top-level directory of this distribution. | ||
# | ||
# Licensed under the MIT license | ||
# <LICENSE-MIT or http://opensource.org/licenses/MIT> | ||
# This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
"""Module that represents list of selected instances as JSON output.""" | ||
from yaml import safe_dump | ||
|
||
from cloudselect import Container | ||
|
||
from . import ReportService | ||
|
||
|
||
class Yaml(ReportService): | ||
"""YAML reporter implementation.""" | ||
|
||
def run(self, selected): | ||
"""Represent instances as YAML output.""" | ||
# get first instance | ||
# assume that all instances match the same group/pattern | ||
instance = next(iter(selected), None) | ||
options = Container.options("option", instance) | ||
report = {"instances": [i.to_dict() for i in selected], "option": options} | ||
print(safe_dump(report, indent=2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ appdirs==1.4.3 | |
boto3==1.11.14 | ||
chardet==3.0.4 | ||
dependency-injector==3.15.4 | ||
pyyaml==5.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ deps = codecov | |
boto3 | ||
chardet | ||
dependency_injector | ||
pyyaml | ||
commands = {posargs:py.test} | ||
codecov: codecov -e TOXENV |