mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-15 17:21:46 +01:00
Reformat with gofumpt
This commit is contained in:
@@ -561,7 +561,6 @@ func (r *NodeRepository) GetNodesForList(
|
|||||||
nodeFilter string,
|
nodeFilter string,
|
||||||
page *model.PageRequest,
|
page *model.PageRequest,
|
||||||
) ([]string, map[string]string, int, bool, error) {
|
) ([]string, map[string]string, int, bool, error) {
|
||||||
|
|
||||||
// Init Return Vars
|
// Init Return Vars
|
||||||
nodes := make([]string, 0)
|
nodes := make([]string, 0)
|
||||||
stateMap := make(map[string]string)
|
stateMap := make(map[string]string)
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ func (fsa *FsArchive) Init(rawConfig json.RawMessage) (uint64, error) {
|
|||||||
if isEmpty {
|
if isEmpty {
|
||||||
cclog.Infof("fsBackend Init() > Bootstrapping new archive at %s", fsa.path)
|
cclog.Infof("fsBackend Init() > Bootstrapping new archive at %s", fsa.path)
|
||||||
versionStr := fmt.Sprintf("%d\n", Version)
|
versionStr := fmt.Sprintf("%d\n", Version)
|
||||||
if err := os.WriteFile(filepath.Join(fsa.path, "version.txt"), []byte(versionStr), 0644); err != nil {
|
if err := os.WriteFile(filepath.Join(fsa.path, "version.txt"), []byte(versionStr), 0o644); err != nil {
|
||||||
cclog.Errorf("fsBackend Init() > failed to create version.txt: %v", err)
|
cclog.Errorf("fsBackend Init() > failed to create version.txt: %v", err)
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -674,7 +674,7 @@ func (fsa *FsArchive) ImportJob(
|
|||||||
|
|
||||||
func (fsa *FsArchive) StoreClusterCfg(name string, config *schema.Cluster) error {
|
func (fsa *FsArchive) StoreClusterCfg(name string, config *schema.Cluster) error {
|
||||||
dir := filepath.Join(fsa.path, name)
|
dir := filepath.Join(fsa.path, name)
|
||||||
if err := os.MkdirAll(dir, 0777); err != nil {
|
if err := os.MkdirAll(dir, 0o777); err != nil {
|
||||||
cclog.Errorf("StoreClusterCfg() > mkdir error: %v", err)
|
cclog.Errorf("StoreClusterCfg() > mkdir error: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ func countJobsNative(archivePath string) (int, error) {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("failed to walk directory: %w", err)
|
return 0, fmt.Errorf("failed to walk directory: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ func main() {
|
|||||||
|
|
||||||
// Run migration
|
// Run migration
|
||||||
migrated, failed, err := migrateArchive(archivePath, dryRun, numWorkers)
|
migrated, failed, err := migrateArchive(archivePath, dryRun, numWorkers)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cclog.Errorf("Migration completed with errors: %s", err.Error())
|
cclog.Errorf("Migration completed with errors: %s", err.Error())
|
||||||
if failed > 0 {
|
if failed > 0 {
|
||||||
@@ -104,5 +103,5 @@ func checkVersion(archivePath string) error {
|
|||||||
|
|
||||||
func updateVersion(archivePath string) error {
|
func updateVersion(archivePath string) error {
|
||||||
versionFile := filepath.Join(archivePath, "version.txt")
|
versionFile := filepath.Join(archivePath, "version.txt")
|
||||||
return os.WriteFile(versionFile, []byte("3\n"), 0644)
|
return os.WriteFile(versionFile, []byte("3\n"), 0o644)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user