Browse code

Remove error return from check graph driver func

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Michael Crosby authored on 2015/01/06 03:34:28
Showing 1 changed files
... ...
@@ -145,19 +145,16 @@ func New(root string, options []string) (driver Driver, err error) {
145 145
 	return nil, fmt.Errorf("No supported storage backend found")
146 146
 }
147 147
 
148
-func checkPriorDriver(name string, root string) error {
149
-
150
-	var priorDrivers []string
151
-
148
+func checkPriorDriver(name, root string) {
149
+	priorDrivers := []string{}
152 150
 	for prior := range drivers {
153
-		if _, err := os.Stat(path.Join(root, prior)); err == nil && prior != name {
154
-			priorDrivers = append(priorDrivers, prior)
151
+		if prior != name {
152
+			if _, err := os.Stat(path.Join(root, prior)); err == nil {
153
+				priorDrivers = append(priorDrivers, prior)
154
+			}
155 155
 		}
156 156
 	}
157
-
158 157
 	if len(priorDrivers) > 0 {
159 158
 		log.Warnf("graphdriver %s selected. Warning: your graphdriver directory %s already contains data managed by other graphdrivers: %s", name, root, strings.Join(priorDrivers, ","))
160 159
 	}
161
-
162
-	return nil
163 160
 }