コード例 #1
0
ファイル: main.go プロジェクト: polvi/nova-agent-watcher
func handleHostname(contents string, scripts_dir string) (*cloudinit.CloudConfig, error) {
	config := cloudinit.CloudConfig{}
	hostname := contents
	// HOSTNAME="polvi-test"
	re := regexp.MustCompile("HOSTNAME=\"(.+)\"")
	keys := re.FindStringSubmatch(hostname)
	if len(keys) == 2 {
		hostname := keys[1]

		config.Hostname = hostname
	}

	return &config, nil
}