Avoid empty cpu_info field
Change-Id: I7edc1e98ec219df143747dcb369dedb0fcbea279
Related-PROD: PROD-24578 (PROD:24578)
diff --git a/openstack/compute/v2/hypervisors/results.go b/openstack/compute/v2/hypervisors/results.go
index 46638cb..a72ed7e 100644
--- a/openstack/compute/v2/hypervisors/results.go
+++ b/openstack/compute/v2/hypervisors/results.go
@@ -112,10 +112,11 @@
default:
return fmt.Errorf("CPUInfo has unexpected type: %T", t)
}
-
- err = json.Unmarshal(tmpb, &r.CPUInfo)
- if err != nil {
- return err
+ if len(tmpb) > 0 {
+ err = json.Unmarshal(tmpb, &r.CPUInfo)
+ if err != nil {
+ return err
+ }
}
// These fields may be passed in in scientific notation