Beispiel #1
0
func (s *volumeListSuite) expect(c *gc.C, machines []string) map[string]map[string]map[string]storage.VolumeInfo {
	//no need for this element as we are building output on out stream not err
	s.mockAPI.addErrItem = false
	all, err := s.mockAPI.ListVolumes(machines)
	c.Assert(err, jc.ErrorIsNil)
	result, err := storage.ConvertToVolumeInfo(all)
	c.Assert(err, jc.ErrorIsNil)
	return result
}
Beispiel #2
0
// expect returns the VolumeInfo mapping we should expect to unmarshal
// from rendered YAML or JSON.
func (s *volumeListSuite) expect(c *gc.C, machines []string) map[string]storage.VolumeInfo {
	all, err := s.mockAPI.ListVolumes(machines)
	c.Assert(err, jc.ErrorIsNil)

	var valid []params.VolumeDetailsResult
	for _, result := range all {
		if result.Error == nil {
			valid = append(valid, result)
		}
	}
	result, err := storage.ConvertToVolumeInfo(valid)
	c.Assert(err, jc.ErrorIsNil)
	return result
}