Adding Tests run and improving reply
This commit is contained in:
@ -50,7 +50,6 @@ func (wi *UCIWirelessInterface) GetSysDevName(sysDir string) string {
|
||||
patt := fmt.Sprintf("%s/%s/.*/address", wi.DevicePath, "net")
|
||||
r, err := regexp.MatchString(patt, path)
|
||||
if err == nil && r {
|
||||
fmt.Println(path)
|
||||
res := strings.Split(path, "/")
|
||||
idx := len(res) - 2
|
||||
found = res[idx]
|
||||
@ -60,7 +59,6 @@ func (wi *UCIWirelessInterface) GetSysDevName(sysDir string) string {
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
fmt.Println(found)
|
||||
wi.SysDevName = found
|
||||
return found
|
||||
}
|
||||
@ -72,7 +70,6 @@ func (wi *UCIWirelessInterface) Create(uci *UCI) *Action {
|
||||
if addRes.ReturnCode != 0 {
|
||||
return addRes
|
||||
}
|
||||
fmt.Println(wi.Index)
|
||||
if wi.Index <= 0 {
|
||||
confPrefix = fmt.Sprintf("wireless.@wifi-iface[%d]", len(uci.Wireless.Interfaces))
|
||||
} else {
|
||||
@ -183,8 +180,6 @@ func (wi *UCIWirelessInterface) Delete(uci *UCI) *Action {
|
||||
// Update add a new entry for wifi interface in UCI Configuration
|
||||
func (wi *UCIWirelessInterface) Update(uci *UCI) *Action {
|
||||
wi.Delete(uci)
|
||||
fmt.Println("IN UPDATE !")
|
||||
fmt.Println(wi)
|
||||
create := wi.Create(uci)
|
||||
if create.ReturnCode != 0 {
|
||||
return create
|
||||
@ -207,7 +202,6 @@ func (wi *UCIWirelessInterface) Connect(uci *UCI, cell *WifiCell, secret string)
|
||||
wi.Encryption = cell.Encryption
|
||||
wi.Mode = "sta"
|
||||
wi.Key = secret
|
||||
fmt.Println(wi)
|
||||
res := wi.Update(uci)
|
||||
if res.ReturnCode != 0 {
|
||||
return res
|
||||
|
Reference in New Issue
Block a user