Skip to content

Commit 3c5c0c5

Browse files
authored
Merge pull request #75 from cobbler/fix/cli-issues
Fix client issues
2 parents 1d19219 + 4de9331 commit 3c5c0c5

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

cobblerclient.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ func (c *Client) updateCobblerFields(what string, item reflect.Value, id string)
415415
}
416416
break
417417
}
418+
419+
if fieldType == "Resource" {
420+
err := c.updateCobblerFields(what, reflect.ValueOf(v.Interface()), id)
421+
if err != nil {
422+
return err
423+
}
424+
break
425+
}
418426
}
419427

420428
// Fields that can inherit from other items can only be set after the parent is set.
@@ -474,7 +482,7 @@ func (c *Client) updateCobblerFields(what string, item reflect.Value, id string)
474482
field := tag.Get("mapstructure")
475483
cobblerTag := tag.Get("cobbler")
476484

477-
if cobblerTag == "noupdate" || fieldType == "Item" || fieldType == "Meta" {
485+
if cobblerTag == "noupdate" || fieldType == "Item" || fieldType == "Resource" || fieldType == "Meta" {
478486
continue
479487
}
480488

fixtures/create-interface-create-interface-req.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</value>
3535
</member>
3636
<member>
37-
<name>ConnectedMode-eth0</name>
37+
<name>connected_mode-eth0</name>
3838
<value>
3939
<boolean>0</boolean>
4040
</value>

fixtures/modify-interface-req.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</value>
3939
</member>
4040
<member>
41-
<name>ConnectedMode-eth0</name>
41+
<name>connected_mode-eth0</name>
4242
<value>
4343
<boolean>0</boolean>
4444
</value>

image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ type Image struct {
167167
VirtPath string `mapstructure:"virt_path"`
168168
VirtRam Value[int] `mapstructure:"virt_ram"`
169169
VirtType string `mapstructure:"virt_type"`
170-
SupportedBootLoaders []string `mapstructure:"supported_boot_loaders"`
170+
SupportedBootLoaders []string `mapstructure:"supported_boot_loaders" cobbler:"noupdate"`
171171

172172
Client
173173
}

system.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type Interface struct {
7878
BondingOpts string `mapstructure:"bonding_opts" structs:"bonding_opts"`
7979
BridgeOpts string `mapstructure:"bridge_opts" structs:"bridge_opts"`
8080
CNAMEs []string `mapstructure:"cnames" structs:"cnames"`
81-
ConnectedMode bool `mapstructure:"connected_mode"`
81+
ConnectedMode bool `mapstructure:"connected_mode" structs:"connected_mode"`
8282
DHCPTag string `mapstructure:"dhcp_tag" structs:"dhcp_tag"`
8383
DNSName string `mapstructure:"dns_name" structs:"dns_name"`
8484
Gateway string `mapstructure:"if_gateway" structs:"if_gateway"`

0 commit comments

Comments
 (0)