File tree Expand file tree Collapse file tree
engine/schema/src/com/cloud/upgrade
plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage
server/src/com/cloud/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 156156 <argument >${basedir} /target/db/cloudbridge_offering_alter.sql</argument >
157157 <!-- Seed the database -->
158158 <argument >${basedir} /developer-prefill.sql</argument >
159+ <argument >${basedir} /developer-prefill.sql.override</argument >
159160 <!-- Do database upgrade-->
160161 <argument >com.cloud.upgrade.DatabaseUpgradeChecker</argument >
161162 <argument >--database=cloud,usage,awsapi</argument >
232233 </build >
233234 </profile >
234235 </profiles >
235- </project >
236+ </project >
Original file line number Diff line number Diff line change @@ -147,6 +147,13 @@ public static void main(String[] args) {
147147 databases = arg .substring (arg .lastIndexOf ("=" ) + 1 , arg .length ()).split ("," );
148148 } else if (arg .endsWith (".sql" )) {
149149 sqlFiles .add (arg );
150+ } else if (arg .endsWith (".sql.override" )) {
151+ if (fileExists (arg )) {
152+ int index = arg .lastIndexOf (".override" );
153+ String fileToOverride = arg .substring (0 , index );
154+ sqlFiles .remove (fileToOverride );
155+ sqlFiles .add (arg );
156+ }
150157 } else if (arg .endsWith (".properties" )) {
151158 if (!dbPropsFile .endsWith ("properties.override" ) && fileExists (arg ))
152159 dbPropsFile = arg ;
Original file line number Diff line number Diff line change @@ -680,7 +680,7 @@ public Answer attachVolume(AttachCommand cmd) {
680680 DiskTO disk = cmd .getDisk ();
681681 VolumeObjectTO vol = (VolumeObjectTO )disk .getData ();
682682 PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO )vol .getDataStore ();
683- String vmName = vol .getVmName ();
683+ String vmName = cmd .getVmName ();
684684 try {
685685 Connect conn = LibvirtConnection .getConnectionByVmName (vmName );
686686 KVMStoragePool primary = storagePoolMgr .getStoragePool (
@@ -714,7 +714,7 @@ public Answer dettachVolume(DettachCommand cmd) {
714714 DiskTO disk = cmd .getDisk ();
715715 VolumeObjectTO vol = (VolumeObjectTO )disk .getData ();
716716 PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO )vol .getDataStore ();
717- String vmName = vol .getVmName ();
717+ String vmName = cmd .getVmName ();
718718 try {
719719 Connect conn = LibvirtConnection .getConnectionByVmName (vmName );
720720 KVMStoragePool primary = storagePoolMgr .getStoragePool (
Original file line number Diff line number Diff line change @@ -224,9 +224,20 @@ public void persistDefaultValues() throws InternalErrorException {
224224 }
225225
226226 String hostIpAdr = NetUtils .getDefaultHostIp ();
227+ boolean needUpdateHostIp = true ;
227228 if (hostIpAdr != null ) {
228- _configDao .update (Config .ManagementHostIPAdr .key (), Config .ManagementHostIPAdr .getCategory (), hostIpAdr );
229- s_logger .debug ("ConfigurationServer saved \" " + hostIpAdr + "\" as host." );
229+ Boolean devel = Boolean .valueOf (_configDao .getValue ("developer" ));
230+ if (devel ) {
231+ String value = _configDao .getValue (Config .ManagementHostIPAdr .key ());
232+ if (value != null ) {
233+ needUpdateHostIp = false ;
234+ }
235+ }
236+
237+ if (needUpdateHostIp ) {
238+ _configDao .update (Config .ManagementHostIPAdr .key (), Config .ManagementHostIPAdr .getCategory (), hostIpAdr );
239+ s_logger .debug ("ConfigurationServer saved \" " + hostIpAdr + "\" as host." );
240+ }
230241 }
231242
232243 // generate a single sign-on key
You can’t perform that action at this time.
0 commit comments