1
0
mirror of https://github.com/rancher/os.git synced 2025-06-26 15:01:34 +00:00

Fix error format in cloudinit

This commit is contained in:
niusmallnan 2018-07-30 17:40:58 +08:00
parent 9d3dd8796e
commit f2b09794e4
7 changed files with 8 additions and 8 deletions

View File

@ -70,7 +70,7 @@ func (cd *ConfigDrive) Finish() error {
func (cd *ConfigDrive) String() string {
if cd.lastError != nil {
return fmt.Sprintf("%s: %s (lastError: %s)", cd.Type(), cd.root, cd.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", cd.Type(), cd.root, cd.lastError)
}
return fmt.Sprintf("%s: %s", cd.Type(), cd.root)
}

View File

@ -41,7 +41,7 @@ func (f *LocalFile) Finish() error {
}
func (f *LocalFile) String() string {
return fmt.Sprintf("%s: %s (lastError: %s)", f.Type(), f.path, f.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", f.Type(), f.path, f.lastError)
}
func (f *LocalFile) AvailabilityChanges() bool {

View File

@ -53,7 +53,7 @@ func (ms Service) IsAvailable() bool {
checkURL := ms.Root + ms.IsAvailableCheckPath
_, ms.lastError = ms.Client.Get(checkURL)
if ms.lastError != nil {
log.Errorf("%s: %s (lastError: %s)", "IsAvailable", checkURL, ms.lastError)
log.Errorf("%s: %s (lastError: %v)", "IsAvailable", checkURL, ms.lastError)
}
return (ms.lastError == nil)
}
@ -63,7 +63,7 @@ func (ms *Service) Finish() error {
}
func (ms *Service) String() string {
return fmt.Sprintf("%s: %s (lastError: %s)", "metadata", ms.UserdataURL(), ms.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", "metadata", ms.UserdataURL(), ms.lastError)
}
func (ms Service) AvailabilityChanges() bool {

View File

@ -57,7 +57,7 @@ func (c *ProcCmdline) Finish() error {
}
func (c *ProcCmdline) String() string {
return fmt.Sprintf("%s: %s (lastError: %s)", c.Type(), c.Location, c.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", c.Type(), c.Location, c.lastError)
}
func (c *ProcCmdline) AvailabilityChanges() bool {

View File

@ -43,7 +43,7 @@ func (f *RemoteFile) Finish() error {
}
func (f *RemoteFile) String() string {
return fmt.Sprintf("%s: %s (lastError: %s)", f.Type(), f.url, f.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", f.Type(), f.url, f.lastError)
}
func (f *RemoteFile) AvailabilityChanges() bool {

View File

@ -40,7 +40,7 @@ func (v VMWare) Finish() error {
}
func (v VMWare) String() string {
return fmt.Sprintf("%s: %s (lastError: %s)", v.Type(), v.ovfFileName, v.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", v.Type(), v.ovfFileName, v.lastError)
}
func (v VMWare) AvailabilityChanges() bool {

View File

@ -47,7 +47,7 @@ func (a *Waagent) Finish() error {
}
func (a *Waagent) String() string {
return fmt.Sprintf("%s: %s (lastError: %s)", a.Type(), a.root, a.lastError)
return fmt.Sprintf("%s: %s (lastError: %v)", a.Type(), a.root, a.lastError)
}
func (a *Waagent) AvailabilityChanges() bool {