Skip to content
Snippets Groups Projects
Commit 0fc756b3 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

Merge branch 'develop' into 227-add-an-option-to-send-gnmi-subscribe-requests-via-sbi

parents 77379c1d ef09a549
No related branches found
No related tags found
3 merge requests!376Add additional example application hostname-checker,!343Add basic application framework and example application to show interaction between events an NBI,!342Resolve "Add an option to send gNMI Subscribe requests via SBI"
Pipeline #110007 passed
......@@ -87,8 +87,14 @@ if they diverge from the default credentials (user:'admin' and pw:'arista').`,
for _, r := range resp.GetResponses() {
spinner.Success("Device has been created with ID: ", r.GetId())
}
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
deviceName, opcode, address, username, password = "", "", "", "", ""
},
}
var deviceName string
......@@ -100,6 +106,6 @@ func init() {
deviceCreateCmd.Flags().StringVar(&deviceName, "name", "", "add a device name (optional)")
deviceCreateCmd.Flags().StringVar(&opcode, "type", "", "generation target (csbi or plugin)")
deviceCreateCmd.Flags().StringVarP(&address, "address", "a", "", "address of a gnmi target, e.g. 192.168.1.1:6030")
deviceCreateCmd.Flags().StringVarP(&username, "username", "u", "admin", "username for a gnmi resource")
deviceCreateCmd.Flags().StringVarP(&password, "password", "p", "arista", "password for a gnmi resource")
deviceCreateCmd.Flags().StringVarP(&username, "username", "u", "", "username for a gnmi resource")
deviceCreateCmd.Flags().StringVarP(&password, "password", "p", "", "password for a gnmi resource")
}
......@@ -105,6 +105,11 @@ To enable replacing behaviour (destructive!), set the --replace flag."`,
}
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
replace, forcePush, file = false, false, ""
},
}
func fileContentToString(path string) (string, error) {
......
......@@ -88,6 +88,11 @@ var loginCmd = &cobra.Command{
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
nbUserName, nbUserPwd, controllerAPIEndpoint = "", "", viper.GetString("controllerAPIEndpoint")
},
}
func init() {
......
......@@ -68,6 +68,11 @@ var logoutCmd = &cobra.Command{
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
nbUserName = ""
},
}
func init() {
......
......@@ -66,6 +66,11 @@ passed using parameters.`,
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
pndName, pndDescription, pndDefaultSbi = "", "", "openconfig"
},
}
var pndName string
......
......@@ -70,6 +70,11 @@ var userCreateCmd = &cobra.Command{
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
nbUserName, nbUserPwd, nbUserRole = "", "", ""
},
}
var nbUserRole string
......
......@@ -58,6 +58,11 @@ var userDeleteCmd = &cobra.Command{
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
nbUserName = ""
},
}
func init() {
......
......@@ -63,6 +63,11 @@ var userGetCmd = &cobra.Command{
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
nbUserName = ""
},
}
func init() {
......
......@@ -71,6 +71,11 @@ var userUpdateCmd = &cobra.Command{
return nil
},
PostRun: func(cmd *cobra.Command, args []string) {
// Necessary for prompt mode. The flag variables have to be resetted,
// since in prompt mode the program keeps running.
nbUserID, nbUserName, nbUserPwd, nbUserRole = "", "", "", ""
},
}
var nbUserID string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment