CLOUDSTACK-7220: fixed building hyper-v agent is broken, commits were not applied in correct order while cherry picking from 4.4-forward to 4.4

This commit is contained in:
Anshul Gangwar 2014-08-01 10:45:14 +05:30 committed by Devdeep Singh
parent d79251853b
commit cda088470b
2 changed files with 1 additions and 20 deletions

View File

@ -236,7 +236,6 @@ namespace HypervResource
{
TemplateObjectTO dataStore = disk.templateObjectTO;
NFSTO share = dataStore.nfsDataStoreTO;
Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password);
string diskPath = Utils.NormalizePath(Path.Combine(share.UncPath, dataStore.path));
wmiCallsV2.AttachIso(vmName, diskPath);
result = true;
@ -244,11 +243,6 @@ namespace HypervResource
else if (disk.type.Equals("DATADISK"))
{
VolumeObjectTO volume = disk.volumeObjectTO;
PrimaryDataStoreTO primary = volume.primaryDataStore;
if (!primary.isLocal)
{
Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
}
string diskPath = Utils.NormalizePath(volume.FullFileName);
wmiCallsV2.AttachDisk(vmName, diskPath, disk.diskSequence);
result = true;
@ -988,8 +982,6 @@ namespace HypervResource
share.uri = new Uri(uriStr);
hostPath = Utils.NormalizePath(share.UncPath);
// Check access to share.
Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password);
Utils.GetShareDetails(share.UncPath, out capacityBytes, out availableBytes);
config.setPrimaryStorage((string)cmd.pool.uuid, hostPath);
}
@ -1281,7 +1273,6 @@ namespace HypervResource
{
volumePath = @"\\" + primary.uri.Host + primary.uri.LocalPath + @"\" + volumeName;
volumePath = Utils.NormalizePath(volumePath);
Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
}
volume.path = volume.uuid;
wmiCallsV2.CreateDynamicVirtualHardDisk(volumeSize, volumePath);
@ -1554,17 +1545,10 @@ namespace HypervResource
if (destTemplateObjectTO.primaryDataStore != null)
{
destFile = destTemplateObjectTO.FullFileName;
if (!destTemplateObjectTO.primaryDataStore.isLocal)
{
PrimaryDataStoreTO primary = destTemplateObjectTO.primaryDataStore;
Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
}
}
else if (destTemplateObjectTO.nfsDataStoreTO != null)
{
destFile = destTemplateObjectTO.FullFileName;
NFSTO store = destTemplateObjectTO.nfsDataStoreTO;
Utils.ConnectToRemote(store.UncPath, store.Domain, store.User, store.Password);
}
}

View File

@ -1,4 +1,4 @@
// Licensed to the Apache Software Foundation (ASF) under one
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
@ -333,7 +333,6 @@ namespace HypervResource
else if (templateInfo != null && templateInfo.nfsDataStoreTO != null)
{
NFSTO share = templateInfo.nfsDataStoreTO;
Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password);
// The share is mapped, now attach the iso
isoPath = Utils.NormalizePath(Path.Combine(share.UncPath, templateInfo.path));
}
@ -2445,8 +2444,6 @@ namespace HypervResource
{
return wmiObj;
}
logger.InfoFormat("In progress... {0}% completed.", jobObj.PercentComplete);
System.Threading.Thread.Sleep(1000);
}
var errMsg = string.Format(