From cda088470b069b4361e87e12e96f2769305e96d9 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Fri, 1 Aug 2014 10:45:14 +0530 Subject: [PATCH] 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 --- .../HypervResource/HypervResourceController.cs | 16 ---------------- .../ServerResource/HypervResource/WmiCallsV2.cs | 5 +---- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index 0ad95b8704a..6ccf8b0e086 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -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); } } diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 2f404ff5ae5..f8868f44c73 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -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(