Skip to content

AlreadyInitCheck has side effects #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Stebalien opened this issue Jul 31, 2019 · 0 comments
Open

AlreadyInitCheck has side effects #123

Stebalien opened this issue Jul 31, 2019 · 0 comments

Comments

@Stebalien
Copy link
Member

Check implies that something is being checked. However, this function does double-duty and handles the force flag.

iptb/testbed/testbed.go

Lines 59 to 69 in 9487788

func AlreadyInitCheck(dir string, force bool) error {
if _, err := os.Stat(filepath.Join(dir, "nodespec.json")); !os.IsNotExist(err) {
if !force && !iptbutil.YesNoPrompt("testbed nodes already exist, overwrite? [y/n]") {
return nil
}
return os.RemoveAll(dir)
}
return nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant