Browse code

utils.go: Fix merge logic for user and hostname.

Fall back to image-specified hostname if user doesn't
provide one, instead of only using image-specified
hostname if the user *does* try to set one.
(ditto for username)

Closes #694.

Will Dietz authored on 2013/05/24 05:48:50
Showing 1 changed files
... ...
@@ -49,10 +49,10 @@ func CompareConfig(a, b *Config) bool {
49 49
 }
50 50
 
51 51
 func MergeConfig(userConf, imageConf *Config) {
52
-	if userConf.Hostname != "" {
52
+	if userConf.Hostname == "" {
53 53
 		userConf.Hostname = imageConf.Hostname
54 54
 	}
55
-	if userConf.User != "" {
55
+	if userConf.User == "" {
56 56
 		userConf.User = imageConf.User
57 57
 	}
58 58
 	if userConf.Memory == 0 {