@@ -32,12 +32,12 @@ import (
32
32
)
33
33
34
34
var (
35
- chap_st = []string {
35
+ chapSt = []string {
36
36
"discovery.sendtargets.auth.username" ,
37
37
"discovery.sendtargets.auth.password" ,
38
38
"discovery.sendtargets.auth.username_in" ,
39
39
"discovery.sendtargets.auth.password_in" }
40
- chap_sess = []string {
40
+ chapSess = []string {
41
41
"node.session.auth.username" ,
42
42
"node.session.auth.password" ,
43
43
"node.session.auth.username_in" ,
@@ -46,15 +46,15 @@ var (
46
46
)
47
47
48
48
func updateISCSIDiscoverydb (b iscsiDiskMounter , tp string ) error {
49
- if ! b .chap_discovery {
49
+ if ! b .chapDiscovery {
50
50
return nil
51
51
}
52
52
out , err := b .exec .Run ("iscsiadm" , "-m" , "discoverydb" , "-t" , "sendtargets" , "-p" , tp , "-I" , b .Iface , "-o" , "update" , "-n" , "discovery.sendtargets.auth.authmethod" , "-v" , "CHAP" )
53
53
if err != nil {
54
54
return fmt .Errorf ("iscsi: failed to update discoverydb with CHAP, output: %v" , string (out ))
55
55
}
56
56
57
- for _ , k := range chap_st {
57
+ for _ , k := range chapSt {
58
58
v := b .secret [k ]
59
59
if len (v ) > 0 {
60
60
out , err := b .exec .Run ("iscsiadm" , "-m" , "discoverydb" , "-t" , "sendtargets" , "-p" , tp , "-I" , b .Iface , "-o" , "update" , "-n" , k , "-v" , v )
@@ -67,7 +67,7 @@ func updateISCSIDiscoverydb(b iscsiDiskMounter, tp string) error {
67
67
}
68
68
69
69
func updateISCSINode (b iscsiDiskMounter , tp string ) error {
70
- if ! b .chap_session {
70
+ if ! b .chapSession {
71
71
return nil
72
72
}
73
73
@@ -76,7 +76,7 @@ func updateISCSINode(b iscsiDiskMounter, tp string) error {
76
76
return fmt .Errorf ("iscsi: failed to update node with CHAP, output: %v" , string (out ))
77
77
}
78
78
79
- for _ , k := range chap_sess {
79
+ for _ , k := range chapSess {
80
80
v := b .secret [k ]
81
81
if len (v ) > 0 {
82
82
out , err := b .exec .Run ("iscsiadm" , "-m" , "node" , "-p" , tp , "-T" , b .Iqn , "-I" , b .Iface , "-o" , "update" , "-n" , k , "-v" , v )
@@ -143,7 +143,7 @@ func (util *ISCSIUtil) persistISCSI(conf iscsiDisk, mnt string) error {
143
143
defer fp .Close ()
144
144
encoder := json .NewEncoder (fp )
145
145
if err = encoder .Encode (conf ); err != nil {
146
- return fmt .Errorf ("iscsi: encode err: %v. " , err )
146
+ return fmt .Errorf ("iscsi: encode err: %v" , err )
147
147
}
148
148
return nil
149
149
}
@@ -158,7 +158,7 @@ func (util *ISCSIUtil) loadISCSI(conf *iscsiDisk, mnt string) error {
158
158
defer fp .Close ()
159
159
decoder := json .NewDecoder (fp )
160
160
if err = decoder .Decode (conf ); err != nil {
161
- return fmt .Errorf ("iscsi: decode err: %v. " , err )
161
+ return fmt .Errorf ("iscsi: decode err: %v" , err )
162
162
}
163
163
return nil
164
164
}
0 commit comments