Index: trunk/extensions/OpenStackManager/OpenStackNovaHost.php |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | $hostEntry['puppetclass'][] = $class; |
185 | 185 | } |
186 | 186 | foreach ( $wgOpenStackManagerPuppetOptions['defaultvariables'] as $variable => $value ) { |
187 | | - $hostEntry['puppetvar'][] = $variable . ' = ' . $value; |
| 187 | + $hostEntry['puppetvar'][] = $variable . '=' . $value; |
188 | 188 | } |
189 | 189 | if ( isset( $puppetinfo['classes'] ) ) { |
190 | 190 | foreach ( $puppetinfo['classes'] as $class ) { |
— | — | @@ -192,9 +192,20 @@ |
193 | 193 | } |
194 | 194 | if ( isset( $puppetinfo['variables'] ) ) { |
195 | 195 | foreach ( $puppetinfo['variables'] as $variable => $value ) { |
196 | | - $hostEntry['puppetvar'][] = $variable . ' = ' . $value; |
| 196 | + $hostEntry['puppetvar'][] = $variable . '=' . $value; |
197 | 197 | } |
198 | 198 | } |
| 199 | + $oldpuppetinfo = $this->getPuppetConfiguration(); |
| 200 | + if ( isset( $oldpuppetinfo['puppetvar'] ) ) { |
| 201 | + $wgAuth->printDebug( "Checking for preexisting variables", NONSENSITIVE ); |
| 202 | + foreach ( $oldpuppetinfo['puppetvar'] as $variable => $value ) { |
| 203 | + $wgAuth->printDebug( "Found $variable", NONSENSITIVE ); |
| 204 | + if ( $variable == "instancecreator_email" || $variable == "instancecreator_username" |
| 205 | + || $variable == "instancecreator_lang" || $variable == "instanceproject" ) { |
| 206 | + $hostEntry['puppetvar'][] = $variable . '=' . $value; |
| 207 | + } |
| 208 | + } |
| 209 | + } |
199 | 210 | if ( $hostEntry ) { |
200 | 211 | wfSuppressWarnings(); |
201 | 212 | $success = ldap_modify( $wgAuth->ldapconn, $this->hostDN, $hostEntry ); |