From 058a6b4e3c6f2d621d9c2e895af625cfa4cb30e3 Mon Sep 17 00:00:00 2001 From: Fabio Verboso Date: Thu, 4 Oct 2018 09:58:36 +0200 Subject: [PATCH] Fix fleet in board creation. Now the fleet can be set during the board creation Change-Id: I413727886d10aed745bdac9e5496d896168dc56c --- iotronicclient/v1/board.py | 2 +- iotronicclient/v1/board_shell.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iotronicclient/v1/board.py b/iotronicclient/v1/board.py index 009a931..8bb5ca3 100644 --- a/iotronicclient/v1/board.py +++ b/iotronicclient/v1/board.py @@ -29,7 +29,7 @@ class Board(base.Resource): class BoardManager(base.CreateManager): resource_class = Board _creation_attributes = ['name', 'code', 'type', 'location', 'mobile', - 'extra'] + 'fleet', 'extra'] _resource_name = 'boards' def list(self, status=None, marker=None, limit=None, diff --git a/iotronicclient/v1/board_shell.py b/iotronicclient/v1/board_shell.py index 28700d3..63850bd 100644 --- a/iotronicclient/v1/board_shell.py +++ b/iotronicclient/v1/board_shell.py @@ -154,6 +154,10 @@ def do_board_list(cc, args): 'altitude', metavar='', help="Altitude of the board ") +@cliutils.arg( + '--fleet', + metavar='', + help="Fleet of the board.") @cliutils.arg( '--mobile', dest='mobile', @@ -168,7 +172,7 @@ def do_board_list(cc, args): "Can be specified multiple times.") def do_board_create(cc, args): """Register a new board with the Iotronic service.""" - field_list = ['name', 'code', 'type', 'mobile', 'extra'] + field_list = ['name', 'code', 'type', 'mobile', 'fleet', 'extra'] fields = dict((k, v) for (k, v) in vars(args).items() if k in field_list and not (v is None))