Beispiel #1
0
Datei: lxd.go Projekt: makyo/juju
func createNetworkProfile(client *lxdclient.Client, profile string) error {
	found, err := client.HasProfile(profile)

	if err != nil {
		return errors.Trace(err)
	}

	if found {
		logger.Infof("deleting existing container profile %q", profile)
		if err := client.ProfileDelete(profile); err != nil {
			return errors.Trace(err)
		}
	}

	err = client.CreateProfile(profile, nil)

	if err == nil {
		logger.Infof("created new network container profile %q", profile)
	}

	return errors.Trace(err)
}