diff --git a/cmd/private_network_create.go b/cmd/private_network_create.go index b148a274..ebf6115b 100644 --- a/cmd/private_network_create.go +++ b/cmd/private_network_create.go @@ -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 { @@ -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) @@ -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) } diff --git a/cmd/private_network_update.go b/cmd/private_network_update.go index b8a79e84..5773cfee 100644 --- a/cmd/private_network_update.go +++ b/cmd/private_network_update.go @@ -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) }) @@ -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) }