Skip to content

Commit

Permalink
incusd: Cleanup in cmdClusterListDatabase
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Bremgartner <[email protected]>
  • Loading branch information
breml authored and stgraber committed Dec 11, 2024
1 parent 3f38d01 commit 4fa8956
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/incusd/main_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@ func (c *cmdClusterListDatabase) Command() *cobra.Command {
}

func (c *cmdClusterListDatabase) Run(cmd *cobra.Command, args []string) error {
os := sys.DefaultOS()
defaultOS := sys.DefaultOS()

db, err := db.OpenNode(filepath.Join(os.VarDir, "database"), nil)
dbconn, err := db.OpenNode(filepath.Join(defaultOS.VarDir, "database"), nil)
if err != nil {
return fmt.Errorf("Failed to open local database: %w", err)
}

addresses, err := cluster.ListDatabaseNodes(db)
addresses, err := cluster.ListDatabaseNodes(dbconn)
if err != nil {
return fmt.Errorf("Failed to get database nodes: %w", err)
}
Expand Down Expand Up @@ -546,7 +546,7 @@ func textEditor(inPath string, inContent []byte) ([]byte, error) {
_ = os.Remove(f.Name())
})

err = os.Chmod(f.Name(), 0600)
err = os.Chmod(f.Name(), 0o600)
if err != nil {
return []byte{}, err
}
Expand Down

0 comments on commit 4fa8956

Please sign in to comment.