(spacePath string)
| 220 | } |
| 221 | |
| 222 | func checkSpace(spacePath string) { |
| 223 | spinner.Message("") |
| 224 | spinner.Suffix(fmt.Sprintf(" Checking space '%s'", spacePath)) |
| 225 | |
| 226 | info, err := os.Stat(spacePath) |
| 227 | if err != nil { |
| 228 | logFailure("Error accessing path '%s': %v", spacePath, err) |
| 229 | return |
| 230 | } |
| 231 | if !info.IsDir() { |
| 232 | logFailure("Error: The provided path '%s' is not a directory\n", spacePath) |
| 233 | return |
| 234 | } |
| 235 | |
| 236 | spaceID, err := xattr.Get(spacePath, spaceIDAttrName) |
| 237 | if err != nil || len(spaceID) == 0 { |
| 238 | logFailure("Error: The directory '%s' does not seem to be a space root, it's missing the '%s' attribute\n", spacePath, spaceIDAttrName) |
| 239 | return |
| 240 | } |
| 241 | |
| 242 | checkSpaceID(spacePath) |
| 243 | checkNodeIDs(spacePath) |
| 244 | } |
| 245 | |
| 246 | func checkSpaceID(spacePath string) { |
| 247 | spinner.Message(" - checking space ID uniqueness") |
no test coverage detected