Skip to content

Commit

Permalink
fix referencing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 29, 2024
1 parent c68e515 commit a37aab5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/private_network_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *privateNetworkCreateCmd) cmdRun(_ *cobra.Command, _ []string) error {
}
}
}

if len(c.NTPServers) > 0 {
for _, server := range c.NTPServers {
if ip := net.ParseIP(server); ip != nil {
Expand All @@ -106,7 +106,7 @@ func (c *privateNetworkCreateCmd) cmdRun(_ *cobra.Command, _ []string) error {
}
}

if len(c.Routers) > 0 {
if len(c.Routers) > 0 {
for _, router := range c.Routers {
if ip := net.ParseIP(router); ip != nil {
opts.Routers = append(opts.Routers, ip)
Expand Down Expand Up @@ -137,7 +137,7 @@ func (c *privateNetworkCreateCmd) cmdRun(_ *cobra.Command, _ []string) error {
if !globalstate.Quiet {
return (&privateNetworkShowCmd{
cliCommandSettings: c.cliCommandSettings,
PrivateNetwork: c.Name,
PrivateNetwork: op.Reference.ID.String(),
Zone: v3.ZoneName(c.Zone),
}).cmdRun(nil, nil)
}
Expand Down
6 changes: 5 additions & 1 deletion cmd/private_network_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,15 @@ func (c *privateNetworkUpdateCmd) cmdRun(cmd *cobra.Command, _ []string) error {
updateReq.Options = opts
updated = true

var privnetID v3.UUID

if updated {
op, err := client.UpdatePrivateNetwork(ctx, pn.ID, updateReq)
if err != nil {
return err
}
privnetID = op.Reference.ID

decorateAsyncOperation(fmt.Sprintf("Updating Private Network %q...", c.Name), func() {
op, err = client.Wait(ctx, op, v3.OperationStateSuccess)
})
Expand All @@ -151,7 +155,7 @@ func (c *privateNetworkUpdateCmd) cmdRun(cmd *cobra.Command, _ []string) error {
if !globalstate.Quiet {
return (&privateNetworkShowCmd{
cliCommandSettings: c.cliCommandSettings,
PrivateNetwork: pn.ID.String(),
PrivateNetwork: privnetID.String(),
Zone: v3.ZoneName(c.Zone),
}).cmdRun(nil, nil)
}
Expand Down

0 comments on commit a37aab5

Please sign in to comment.