Skip to content

Commit 203e2ac

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #836 from SoftLayer/issues330
`vs ready` will now check for Transaction Status, not `isPingable`
2 parents cf8db63 + e1c362a commit 203e2ac

21 files changed

Lines changed: 87 additions & 393 deletions

plugin/commands/virtual/create.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package virtual
33
import (
44
"encoding/json"
55
"errors"
6-
"fmt"
6+
77
"io/ioutil"
88
"strconv"
99
"time"
@@ -363,7 +363,6 @@ func (cmd *CreateCommand) verifyParams() (map[string]interface{}, error) {
363363

364364
if cmd.Flavor != "" {
365365
if cmd.CPU != 0 {
366-
fmt.Printf("Returning an error....\n")
367366
return nil, slErrors.NewExclusiveFlagsError("[-c|--cpu]", "[--flavor]")
368367
}
369368
if cmd.Memory != 0 {
@@ -488,12 +487,10 @@ func (cmd *CreateCommand) verifyParams() (map[string]interface{}, error) {
488487
}
489488

490489
if len(cmd.PubSecGroup) > 0 {
491-
fmt.Printf("PubSecGroup(%v): %v\n", cmd.Domain, cmd.PubSecGroup)
492490
params["public-security-group"] = cmd.PubSecGroup
493491
}
494492

495493
if len(cmd.PriSecGroup) > 0 {
496-
fmt.Printf("PriSecGroup: %v\n", cmd.PriSecGroup)
497494
params["private-security-group"] = cmd.PriSecGroup
498495
}
499496

plugin/commands/virtual/ready.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ func NewReadyCommand(sl *metadata.SoftlayerCommand) (cmd *ReadyCommand) {
2727
cobraCmd := &cobra.Command{
2828
Use: "ready " + T("IDENTIFIER"),
2929
Short: T("Check if a virtual server instance is ready for use"),
30-
Long: T(`${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONS]
31-
32-
EXAMPLE:
33-
${COMMAND_NAME} sl vs ready 12345678 --wait 30
34-
This command checks virtual server instance with ID 12345678 status to see if it is ready for use continuously and waits up to 30 seconds.`),
30+
Long: T(`Will periodically check the status of a virtual server's active transaction.
31+
When the transcation is finished the virtual server should be ready for use.`),
3532
Args: metadata.OneArgs,
3633
RunE: func(cmd *cobra.Command, args []string) error {
3734
return thisCmd.Run(args)
@@ -52,7 +49,7 @@ func (cmd *ReadyCommand) Run(args []string) error {
5249
ready, message, err := cmd.VirtualServerManager.InstanceIsReady(vsID, until)
5350
subs := map[string]interface{}{"VsID": vsID, "VsId": vsID}
5451
if err != nil {
55-
return slErrors.NewAPIError(T("Failed to check virtual server instance {{.VsID}} is ready.\n", subs), err.Error(), 2)
52+
return err
5653
}
5754
if ready {
5855
cmd.UI.Print(T("Virtual server instance: {{.VsId}} is ready.", subs))

plugin/commands/virtual/ready_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ var _ = Describe("VS ready", func() {
5454
It("return error", func() {
5555
err := testhelpers.RunCobraCommand(cliCommand.Command, "1234")
5656
Expect(err).To(HaveOccurred())
57-
Expect(err.Error()).To(ContainSubstring("Failed to check virtual server instance 1234 is ready."))
5857
Expect(err.Error()).To(ContainSubstring("Internal Server Error"))
5958
})
6059
})

plugin/i18n/resources/de_DE.all.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,6 @@
451451
"id": "${COMMAND_NAME} sl vs migrate [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs migrate --guest 1234567\n Manage VSIs that require migration. Can migrate Dedicated Instance from one dedicated host to another dedicated host as well.",
452452
"translation": "${COMMAND_NAME} sl vs migrate [OPTIONEN]\n \nBEISPIEL:\n ${COMMAND_NAME} sl vs migrate --guest 1234567\n VSIs verwalten, die eine Migration erfordern. Kann auch eine dedizierte Instanz von einem dedizierten Host auf einen anderen dedizierten Host migrieren."
453453
},
454-
{
455-
"id": "${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs ready 12345678 --wait 30\n This command checks virtual server instance with ID 12345678 status to see if it is ready for use continuously and waits up to 30 seconds.",
456-
"translation": "${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONEN]\n\t\nBEISPIEL:\n ${COMMAND_NAME} sl vs ready 12345678 --wait 30\n Dieser Befehl prüft den Status der virtuellen Serverinstanz mit der ID 12345678 darauf hin, ob sie durchgehend betriebsbereit ist, und wartet bis zu 30 Sekunden."
457-
},
458454
{
459455
"id": "${COMMAND_NAME} sl vs reload IDENTIFIER [OPTIONS]\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs reload 12345678\n This command reloads current operating system for virtual server instance with ID 12345678.\n ${COMMAND_NAME} sl vs reload 12345678 --image 1234\n This command reloads operating system from image with ID 1234 for virtual server instance with ID 12345678.",
460456
"translation": "${COMMAND_NAME} sl vs reload IDENTIFIER [OPTIONEN]\n\nBEISPIEL:\n ${COMMAND_NAME} sl vs reload 12345678\n Dieser Befehl lädt das aktuelle Betriebssystem für die virtuelle Serverinstanz mit der ID 12345678 neu.\n ${COMMAND_NAME} sl vs reload 12345678 --image 1234\n Dieser Befehl lädt das Betriebssystem aus dem Image mit der ID 1234 für die virtuelle Serverinstanz mit der ID 12345678 neu."
@@ -3031,10 +3027,6 @@
30313027
"id": "Failed to capture image for virtual server instance: {{.VsID}}.\n",
30323028
"translation": "Erfassen eines Images für die virtuelle Serverinstanz {{.VsID}} fehlgeschlagen.\n"
30333029
},
3034-
{
3035-
"id": "Failed to check virtual server instance {{.VsID}} is ready.\n",
3036-
"translation": "Prüfen der Bereitschaft der virtuellen Serverinstanz {{.VsID}} fehlgeschlagen.\n"
3037-
},
30383030
{
30393031
"id": "Failed to confirm the new LUN ID on volume {{.VolumeId}}.",
30403032
"translation": "Bestätigen der neuen LUN-ID für Datenträger {{.VolumeId}} fehlschlagen."
@@ -3779,10 +3771,6 @@
37793771
"id": "Failed to get the vlans available for datacener: {{.DATACENTER}} and flavor: {{.FLAVOR}}.",
37803772
"translation": "Die für Rechenzentrum {{.DATACENTER}} und Version {{.FLAVOR}} verfügbaren VLANs konnten nicht abgerufen werden."
37813773
},
3782-
{
3783-
"id": "Failed to get this virtual guest instance.",
3784-
"translation": "Abrufen dieser virtuellen Gastinstanz fehlgeschlagen."
3785-
},
37863774
{
37873775
"id": "Failed to get translation with ID {{.TransID}} from IPSec {{.ID}}.",
37883776
"translation": "Abrufen der Umsetzung mit ID {{.TransID}} von IPSec {{.ID}} fehlgeschlagen."
@@ -4075,10 +4063,6 @@
40754063
"id": "Failed to purge.",
40764064
"translation": "Löschen fehlgeschlagen."
40774065
},
4078-
{
4079-
"id": "Failed to reach virtual guest instance {{.Id}}.",
4080-
"translation": "Erreichen der virtuellen Gastinstanz {{.Id}} fehlgeschlagen."
4081-
},
40824066
{
40834067
"id": "Failed to read SSH key from file: {{.File}}.\n",
40844068
"translation": "Lesen des SSH-Schlüssels aus der Datei {{.File}} fehlgeschlagen.\n"
@@ -9495,22 +9479,6 @@
94959479
"id": "Virtual guest domain name not found.",
94969480
"translation": "Domänenname des virtuellen Gastsystems nicht gefunden."
94979481
},
9498-
{
9499-
"id": "Virtual guest instance {{.Id}} is loading operating system.",
9500-
"translation": "Die virtuelle Gastinstanz {{.Id}} lädt das Betriebssystem."
9501-
},
9502-
{
9503-
"id": "Virtual guest instance {{.Id}} is not reachable.",
9504-
"translation": "Die virtuelle Gastinstanz {{.Id}} ist nicht erreichbar."
9505-
},
9506-
{
9507-
"id": "Virtual guest instance {{.Id}} is paused.",
9508-
"translation": "Die virtuelle Gastinstanz {{.Id}} wurde angehalten."
9509-
},
9510-
{
9511-
"id": "Virtual guest instance {{.Id}} is power off.",
9512-
"translation": "Die virtuelle Gastinstanz {{.Id}} wurde ausgeschaltet."
9513-
},
95149482
{
95159483
"id": "Virtual server ID should be a number.",
95169484
"translation": "Die ID des virtuellen Servers muss eine Zahl sein."

plugin/i18n/resources/en_US.all.json

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,6 @@
451451
"id": "${COMMAND_NAME} sl vs migrate [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs migrate --guest 1234567\n Manage VSIs that require migration. Can migrate Dedicated Instance from one dedicated host to another dedicated host as well.",
452452
"translation": "${COMMAND_NAME} sl vs migrate [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs migrate --guest 1234567\n Manage VSIs that require migration. Can migrate Dedicated Instance from one dedicated host to another dedicated host as well."
453453
},
454-
{
455-
"id": "${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs ready 12345678 --wait 30\n This command checks virtual server instance with ID 12345678 status to see if it is ready for use continuously and waits up to 30 seconds.",
456-
"translation": "${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs ready 12345678 --wait 30\n This command checks virtual server instance with ID 12345678 status to see if it is ready for use continuously and waits up to 30 seconds."
457-
},
458454
{
459455
"id": "${COMMAND_NAME} sl vs reload IDENTIFIER [OPTIONS]\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs reload 12345678\n This command reloads current operating system for virtual server instance with ID 12345678.\n ${COMMAND_NAME} sl vs reload 12345678 --image 1234\n This command reloads operating system from image with ID 1234 for virtual server instance with ID 12345678.",
460456
"translation": "${COMMAND_NAME} sl vs reload IDENTIFIER [OPTIONS]\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs reload 12345678\n This command reloads current operating system for virtual server instance with ID 12345678.\n ${COMMAND_NAME} sl vs reload 12345678 --image 1234\n This command reloads operating system from image with ID 1234 for virtual server instance with ID 12345678."
@@ -3031,10 +3027,6 @@
30313027
"id": "Failed to capture image for virtual server instance: {{.VsID}}.\n",
30323028
"translation": "Failed to capture image for virtual server instance: {{.VsID}}.\n"
30333029
},
3034-
{
3035-
"id": "Failed to check virtual server instance {{.VsID}} is ready.\n",
3036-
"translation": "Failed to check virtual server instance {{.VsID}} is ready.\n"
3037-
},
30383030
{
30393031
"id": "Failed to confirm the new LUN ID on volume {{.VolumeId}}.",
30403032
"translation": "Failed to confirm the new LUN ID on volume {{.VolumeId}}."
@@ -3779,10 +3771,6 @@
37793771
"id": "Failed to get the vlans available for datacener: {{.DATACENTER}} and flavor: {{.FLAVOR}}.",
37803772
"translation": "Failed to get the vlans available for datacener: {{.DATACENTER}} and flavor: {{.FLAVOR}}."
37813773
},
3782-
{
3783-
"id": "Failed to get this virtual guest instance.",
3784-
"translation": "Failed to get this virtual guest instance."
3785-
},
37863774
{
37873775
"id": "Failed to get translation with ID {{.TransID}} from IPSec {{.ID}}.",
37883776
"translation": "Failed to get translation with ID {{.TransID}} from IPSec {{.ID}}."
@@ -4075,10 +4063,6 @@
40754063
"id": "Failed to purge.",
40764064
"translation": "Failed to purge."
40774065
},
4078-
{
4079-
"id": "Failed to reach virtual guest instance {{.Id}}.",
4080-
"translation": "Failed to reach virtual guest instance {{.Id}}."
4081-
},
40824066
{
40834067
"id": "Failed to read SSH key from file: {{.File}}.\n",
40844068
"translation": "Failed to read SSH key from file: {{.File}}.\n"
@@ -9519,22 +9503,6 @@
95199503
"id": "Virtual guest domain name not found.",
95209504
"translation": "Virtual guest domain name not found."
95219505
},
9522-
{
9523-
"id": "Virtual guest instance {{.Id}} is loading operating system.",
9524-
"translation": "Virtual guest instance {{.Id}} is loading operating system."
9525-
},
9526-
{
9527-
"id": "Virtual guest instance {{.Id}} is not reachable.",
9528-
"translation": "Virtual guest instance {{.Id}} is not reachable."
9529-
},
9530-
{
9531-
"id": "Virtual guest instance {{.Id}} is paused.",
9532-
"translation": "Virtual guest instance {{.Id}} is paused."
9533-
},
9534-
{
9535-
"id": "Virtual guest instance {{.Id}} is power off.",
9536-
"translation": "Virtual guest instance {{.Id}} is power off."
9537-
},
95389506
{
95399507
"id": "Virtual server ID should be a number.",
95409508
"translation": "Virtual server ID should be a number."
@@ -9627,6 +9595,10 @@
96279595
"id": "Whether or not this duplicate will be a dependent duplicate of the origin volume.",
96289596
"translation": "Whether or not this duplicate will be a dependent duplicate of the origin volume."
96299597
},
9598+
{
9599+
"id": "Will periodically check the status of a virtual server's active transaction.\nWhen the transcation is finished the virtual server should be ready for use.",
9600+
"translation": "Will periodically check the status of a virtual server's active transaction.\nWhen the transcation is finished the virtual server should be ready for use."
9601+
},
96309602
{
96319603
"id": "Would you like to submit the rules. Continue?",
96329604
"translation": "Would you like to submit the rules. Continue?"

plugin/i18n/resources/es_ES.all.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,6 @@
451451
"id": "${COMMAND_NAME} sl vs migrate [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs migrate --guest 1234567\n Manage VSIs that require migration. Can migrate Dedicated Instance from one dedicated host to another dedicated host as well.",
452452
"translation": "${COMMAND_NAME} sl vs migrate [OPTIONS]\n\nEJEMPLO:\n ${COMMAND_NAME} sl vs migrate --guest 1234567\n Gestionar las VSI que requieran migración. Puede migrar la Instancia dedicada de un host dedicado a otro host dedicado también."
453453
},
454-
{
455-
"id": "${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs ready 12345678 --wait 30\n This command checks virtual server instance with ID 12345678 status to see if it is ready for use continuously and waits up to 30 seconds.",
456-
"translation": "${COMMAND_NAME} sl vs ready IDENTIFIER [OPTIONS]\n\t\nEJEMPLO:\n ${COMMAND_NAME} sl vs ready 12345678 --wait 30\n Este mandato comprueba la instancia de servidor virtual con el estado del ID 12345678 para ver si está lista para su uso continuado y espera hasta 30 segundos."
457-
},
458454
{
459455
"id": "${COMMAND_NAME} sl vs reload IDENTIFIER [OPTIONS]\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs reload 12345678\n This command reloads current operating system for virtual server instance with ID 12345678.\n ${COMMAND_NAME} sl vs reload 12345678 --image 1234\n This command reloads operating system from image with ID 1234 for virtual server instance with ID 12345678.",
460456
"translation": "${COMMAND_NAME} sl vs reload IDENTIFIER [OPTIONS]\n\nEJEMPLO:\n ${COMMAND_NAME} sl vs reload 12345678\n Este mandato vuelve a cargar el sistema operativo actual para la instancia de servidor virtual con el ID 12345678.\n ${COMMAND_NAME} sl vs reload 12345678 --image 1234\n Este mandato vuelve a cargar el sistema operativo a partir de la imagen con el ID 1234 para la instancia de servidor virtual con el ID 12345678."
@@ -3031,10 +3027,6 @@
30313027
"id": "Failed to capture image for virtual server instance: {{.VsID}}.\n",
30323028
"translation": "No se ha podido capturar la imagen para la instancia de servidor virtual: {{.VsID}}.\n"
30333029
},
3034-
{
3035-
"id": "Failed to check virtual server instance {{.VsID}} is ready.\n",
3036-
"translation": "No se ha podido comprobar si la instancia de servidor virtual {{.VsID}} está preparada.\n"
3037-
},
30383030
{
30393031
"id": "Failed to confirm the new LUN ID on volume {{.VolumeId}}.",
30403032
"translation": "No se ha podido confirmar el nuevo ID de LUN en el volumen {{.VolumeId}}."
@@ -3779,10 +3771,6 @@
37793771
"id": "Failed to get the vlans available for datacener: {{.DATACENTER}} and flavor: {{.FLAVOR}}.",
37803772
"translation": "No se han podido obtener las vlans disponibles para el centro de datos: {{.DATACENTER}} y el tipo: {{.FLAVOR}}."
37813773
},
3782-
{
3783-
"id": "Failed to get this virtual guest instance.",
3784-
"translation": "No se ha podido obtener esta instancia de invitado virtual."
3785-
},
37863774
{
37873775
"id": "Failed to get translation with ID {{.TransID}} from IPSec {{.ID}}.",
37883776
"translation": "No se ha podido obtener conversión con ID {{.TransID}} de la IPSec {{.ID}}."
@@ -4075,10 +4063,6 @@
40754063
"id": "Failed to purge.",
40764064
"translation": "No se ha podido depurar."
40774065
},
4078-
{
4079-
"id": "Failed to reach virtual guest instance {{.Id}}.",
4080-
"translation": "No se ha podido alcanzar la instancia de invitado virtual {{.Id}}."
4081-
},
40824066
{
40834067
"id": "Failed to read SSH key from file: {{.File}}.\n",
40844068
"translation": "No se ha podido leer la clave SSH del archivo: {{.File}}.\n"
@@ -9495,22 +9479,6 @@
94959479
"id": "Virtual guest domain name not found.",
94969480
"translation": "No se ha encontrado el nombre de dominio de invitado virtual."
94979481
},
9498-
{
9499-
"id": "Virtual guest instance {{.Id}} is loading operating system.",
9500-
"translation": "La instancia de invitado virtual {{.Id}} está cargando el sistema operativo."
9501-
},
9502-
{
9503-
"id": "Virtual guest instance {{.Id}} is not reachable.",
9504-
"translation": "La instancia de invitado virtual {{.Id}} es inalcanzable."
9505-
},
9506-
{
9507-
"id": "Virtual guest instance {{.Id}} is paused.",
9508-
"translation": "La instancia de invitado virtual {{.Id}} se ha detenido."
9509-
},
9510-
{
9511-
"id": "Virtual guest instance {{.Id}} is power off.",
9512-
"translation": "La instancia de invitado virtual {{.Id}} se ha apagado."
9513-
},
95149482
{
95159483
"id": "Virtual server ID should be a number.",
95169484
"translation": "El ID de servidor virtual debe ser un número."

0 commit comments

Comments
 (0)