Skip to content

Commit 0b6de4b

Browse files
author
Lou
committed
rename portal with p to reduce changes
Signed-off-by: Lou <[email protected]>
1 parent 48d389d commit 0b6de4b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

iscsi/iscsi.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ func Connect(c Connector) (string, error) {
269269
port = target.Port
270270
}
271271
// 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)}, "-")
274274
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)}, "-")
276276
}
277277

278-
exists, _ := sessionExists(portal, target.Iqn)
278+
exists, _ := sessionExists(p, target.Iqn)
279279
if exists {
280280
if exists, err := waitForPathToExist(&devicePath, 1, 1, iscsiTransport); exists {
281281
debug.Printf("Appending device path: %s", devicePath)
@@ -288,22 +288,22 @@ func Connect(c Connector) (string, error) {
288288

289289
if c.DoDiscovery {
290290
// 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 {
292292
debug.Printf("Error in discovery of the target: %s\n", err.Error())
293293
lastErr = err
294294
continue
295295
}
296296
}
297297

298298
// 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)
300300
if err != nil {
301301
debug.Printf("Error creating db entry: %s\n", err.Error())
302302
continue
303303
}
304304

305305
// perform the login
306-
err = Login(target.Iqn, portal)
306+
err = Login(target.Iqn, p)
307307
if err != nil {
308308
debug.Printf("failed to login, err: %v", err)
309309
lastErr = err

0 commit comments

Comments
 (0)