Skip to content

Commit d2c7784

Browse files
committed
Update CleanStep struct to support manual cleaning
Currently, the **Args** property in CleanStep struct has **map[string]string that does not match with manual cleaning steps in Ironic. It should be dictionary in python[1][2] and interface{} in golang. For example: BIOS setting for a node: ``` [ { "interface": "bios", "step": "apply_configuration", "args": { "settings": [{"name": "hyper_threading_enabled", "value": "false"}] } } ] ``` This PR aims to update **Args** in **CleanStep** struct. [1] https://github.com/openstack/ironic/blob/master/ironic/api/controllers/v1/node.py#L76 [2] https://github.com/openstack/ironic/blob/master/ironic/api/controllers/v1/node.py#L624 Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
1 parent 2949719 commit d2c7784

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

openstack/baremetal/v1/nodes/requests.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ func GetSupportedBootDevices(client *gophercloud.ServiceClient, id string) (r Su
388388
// the value for ‘args’ is a keyword variable argument dictionary that is passed to the cleaning step
389389
// method.
390390
type CleanStep struct {
391-
Interface string `json:"interface" required:"true"`
392-
Step string `json:"step" required:"true"`
393-
Args map[string]string `json:"args,omitempty"`
391+
Interface string `json:"interface" required:"true"`
392+
Step string `json:"step" required:"true"`
393+
Args map[string]interface{} `json:"args,omitempty"`
394394
}
395395

396396
// ProvisionStateOptsBuilder allows extensions to add additional parameters to the

openstack/baremetal/v1/nodes/testing/requests_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func TestNodeChangeProvisionStateClean(t *testing.T) {
282282
{
283283
Interface: "deploy",
284284
Step: "upgrade_firmware",
285-
Args: map[string]string{
285+
Args: map[string]interface{}{
286286
"force": "True",
287287
},
288288
},
@@ -304,7 +304,7 @@ func TestNodeChangeProvisionStateCleanWithConflict(t *testing.T) {
304304
{
305305
Interface: "deploy",
306306
Step: "upgrade_firmware",
307-
Args: map[string]string{
307+
Args: map[string]interface{}{
308308
"force": "True",
309309
},
310310
},
@@ -323,7 +323,7 @@ func TestCleanStepRequiresInterface(t *testing.T) {
323323
CleanSteps: []nodes.CleanStep{
324324
{
325325
Step: "upgrade_firmware",
326-
Args: map[string]string{
326+
Args: map[string]interface{}{
327327
"force": "True",
328328
},
329329
},
@@ -342,7 +342,7 @@ func TestCleanStepRequiresStep(t *testing.T) {
342342
CleanSteps: []nodes.CleanStep{
343343
{
344344
Interface: "deploy",
345-
Args: map[string]string{
345+
Args: map[string]interface{}{
346346
"force": "True",
347347
},
348348
},

0 commit comments

Comments
 (0)