Added supported_formats
We allow outputs to be in YAML or JSON formats.
This commit is contained in:
@@ -13,7 +13,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import yaml
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
|
||||
from senlinclient.openstack.common import cliutils
|
||||
@@ -26,6 +28,11 @@ env = cliutils.env
|
||||
print_list = cliutils.print_list
|
||||
exit = cliutils.exit
|
||||
|
||||
supported_formats = {
|
||||
"json": lambda x: jsonutils.dumps(x, indent=2),
|
||||
"yaml": yaml.safe_dump
|
||||
}
|
||||
|
||||
|
||||
def import_versioned_module(version, submodule=None):
|
||||
module = 'senlinclient.v%s' % version
|
||||
|
||||
Reference in New Issue
Block a user