@@ -80,7 +80,6 @@ func CreateDBEntry(tgtIQN, portal, iFace string, discoverySecrets, sessionSecret
80
80
}
81
81
82
82
return err
83
-
84
83
}
85
84
86
85
// Discoverydb discovers the iscsi target
@@ -100,7 +99,7 @@ func Discoverydb(tp, iface string, discoverySecrets Secrets, chapDiscovery bool)
100
99
101
100
_ , err = iscsiCmd (append (baseArgs , []string {"--discover" }... )... )
102
101
if err != nil {
103
- //delete the discoverydb record
102
+ // delete the discoverydb record
104
103
iscsiCmd (append (baseArgs , []string {"-o" , "delete" }... )... )
105
104
return fmt .Errorf ("failed to sendtargets to portal %s, err: %v" , tp , err )
106
105
}
@@ -111,10 +110,12 @@ func createCHAPEntries(baseArgs []string, secrets Secrets, discovery bool) error
111
110
args := []string {}
112
111
debug .Printf ("Begin createCHAPEntries (discovery=%t)..." , discovery )
113
112
if discovery {
114
- args = append (baseArgs , []string {"-o" , "update" ,
113
+ args = append (baseArgs , []string {
114
+ "-o" , "update" ,
115
115
"-n" , "discovery.sendtargets.auth.authmethod" , "-v" , "CHAP" ,
116
116
"-n" , "discovery.sendtargets.auth.username" , "-v" , secrets .UserName ,
117
- "-n" , "discovery.sendtargets.auth.password" , "-v" , secrets .Password }... )
117
+ "-n" , "discovery.sendtargets.auth.password" , "-v" , secrets .Password ,
118
+ }... )
118
119
if secrets .UserNameIn != "" {
119
120
args = append (args , []string {"-n" , "discovery.sendtargets.auth.username_in" , "-v" , secrets .UserNameIn }... )
120
121
}
@@ -124,10 +125,12 @@ func createCHAPEntries(baseArgs []string, secrets Secrets, discovery bool) error
124
125
125
126
} else {
126
127
127
- args = append (baseArgs , []string {"-o" , "update" ,
128
+ args = append (baseArgs , []string {
129
+ "-o" , "update" ,
128
130
"-n" , "node.session.auth.authmethod" , "-v" , "CHAP" ,
129
131
"-n" , "node.session.auth.username" , "-v" , secrets .UserName ,
130
- "-n" , "node.session.auth.password" , "-v" , secrets .Password }... )
132
+ "-n" , "node.session.auth.password" , "-v" , secrets .Password ,
133
+ }... )
131
134
if secrets .UserNameIn != "" {
132
135
args = append (args , []string {"-n" , "node.session.auth.username_in" , "-v" , secrets .UserNameIn }... )
133
136
}
@@ -156,7 +159,7 @@ func Login(tgtIQN, portal string) error {
156
159
debug .Println ("Begin Login..." )
157
160
baseArgs := []string {"-m" , "node" , "-T" , tgtIQN , "-p" , portal }
158
161
if _ , err := iscsiCmd (append (baseArgs , []string {"-l" }... )... ); err != nil {
159
- //delete the node record from database
162
+ // delete the node record from database
160
163
iscsiCmd (append (baseArgs , []string {"-o" , "delete" }... )... )
161
164
return fmt .Errorf ("failed to sendtargets to portal %s, err: %v" , portal , err )
162
165
}
0 commit comments