@@ -269,13 +269,13 @@ func Connect(c Connector) (string, error) {
269
269
port = target .Port
270
270
}
271
271
// portal with port
272
- portal := strings .Join ([]string {target .Portal , port }, ":" )
273
- devicePath := strings .Join ([]string {"/dev/disk/by-path/ip" , portal , "iscsi" , target .Iqn , "lun" , fmt .Sprint (c .Lun )}, "-" )
272
+ p := strings .Join ([]string {target .Portal , port }, ":" )
273
+ devicePath := strings .Join ([]string {"/dev/disk/by-path/ip" , p , "iscsi" , target .Iqn , "lun" , fmt .Sprint (c .Lun )}, "-" )
274
274
if iscsiTransport != "tcp" {
275
- devicePath = strings .Join ([]string {"/dev/disk/by-path/pci" , "*" , "ip" , portal , "iscsi" , target .Iqn , "lun" , fmt .Sprint (c .Lun )}, "-" )
275
+ devicePath = strings .Join ([]string {"/dev/disk/by-path/pci" , "*" , "ip" , p , "iscsi" , target .Iqn , "lun" , fmt .Sprint (c .Lun )}, "-" )
276
276
}
277
277
278
- exists , _ := sessionExists (portal , target .Iqn )
278
+ exists , _ := sessionExists (p , target .Iqn )
279
279
if exists {
280
280
if exists , err := waitForPathToExist (& devicePath , 1 , 1 , iscsiTransport ); exists {
281
281
debug .Printf ("Appending device path: %s" , devicePath )
@@ -288,22 +288,22 @@ func Connect(c Connector) (string, error) {
288
288
289
289
if c .DoDiscovery {
290
290
// build discoverydb and discover iscsi target
291
- if err := Discovery (portal , iFace , c .DiscoverySecrets , c .DoCHAPDiscovery ); err != nil {
291
+ if err := Discovery (p , iFace , c .DiscoverySecrets , c .DoCHAPDiscovery ); err != nil {
292
292
debug .Printf ("Error in discovery of the target: %s\n " , err .Error ())
293
293
lastErr = err
294
294
continue
295
295
}
296
296
}
297
297
298
298
// Make sure we don't log the secrets
299
- err := CreateDBEntry (target .Iqn , portal , iFace , c .DiscoverySecrets , c .SessionSecrets , c .DoCHAPDiscovery )
299
+ err := CreateDBEntry (target .Iqn , p , iFace , c .DiscoverySecrets , c .SessionSecrets , c .DoCHAPDiscovery )
300
300
if err != nil {
301
301
debug .Printf ("Error creating db entry: %s\n " , err .Error ())
302
302
continue
303
303
}
304
304
305
305
// perform the login
306
- err = Login (target .Iqn , portal )
306
+ err = Login (target .Iqn , p )
307
307
if err != nil {
308
308
debug .Printf ("failed to login, err: %v" , err )
309
309
lastErr = err
0 commit comments