Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-tools

…into dev
  • Loading branch information...
commit 70c488e95e0901b8127154df0584292734734b39 2 parents 3bc7695 + 8507789
markcowl authored
View
2  WindowsAzurePowershell/setup/azurecmdfiles.wxi
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="PowerShellFolder">
View
24 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/NewAzureRoleTemplateTests.cs
@@ -16,6 +16,7 @@ namespace Microsoft.WindowsAzure.Management.CloudService.Test.Tests
{
using System.IO;
using System.Management.Automation;
+ using System.Reflection;
using CloudService.Cmdlet;
using CloudService.Properties;
using Microsoft.WindowsAzure.Management.CloudService.Model;
@@ -24,7 +25,6 @@ namespace Microsoft.WindowsAzure.Management.CloudService.Test.Tests
using Microsoft.WindowsAzure.Management.Services;
using Microsoft.WindowsAzure.Management.Test.Stubs;
using Microsoft.WindowsAzure.Management.Test.Tests.Utilities;
- using Utilities;
using VisualStudio.TestTools.UnitTesting;
[TestClass]
@@ -95,5 +95,27 @@ public void NewAzureRoleTemplateWithDirectoryExists()
Testing.AssertDirectoryIdentical(Path.Combine(Resources.GeneralScaffolding, RoleType.WorkerRole.ToString()), outputPath);
}
}
+
+ [TestMethod]
+ public void NewAzureRoleTemplateWithRunningOutsideDefaultDirectory()
+ {
+ string outputPath = Path.Combine(Directory.GetCurrentDirectory(), "TestDir", "WebRoleTemplate");
+ addTemplateCmdlet = new NewAzureRoleTemplateCommand() { Web = true, CommandRuntime = mockCommandRuntime };
+ string originalDir = Directory.GetCurrentDirectory();
+ Directory.CreateDirectory("TestDir");
+ Directory.SetCurrentDirectory("TestDir");
+
+ try
+ {
+ addTemplateCmdlet.ExecuteCmdlet();
+
+ Assert.AreEqual<string>(outputPath, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue<string>(Parameters.Path));
+ Testing.AssertDirectoryIdentical(Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Resources.GeneralScaffolding, RoleType.WebRole.ToString())), outputPath);
+ }
+ finally
+ {
+ Directory.SetCurrentDirectory(originalDir);
+ }
+ }
}
}
View
7 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Python/Cmdlet/AddAzurePythonWebRoleTests.cs
@@ -86,6 +86,13 @@ out stdErr
AzureAssert.ScaffoldingExists(Path.Combine(rootPath, roleName), Path.Combine(Resources.PythonScaffolding, Resources.WebRole));
Assert.AreEqual<string>(roleName, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue<string>(Parameters.RoleName));
Assert.AreEqual<string>(expectedVerboseMessage, mockCommandRuntime.VerboseStream[0]);
+ Assert.IsTrue(Directory.Exists(Path.Combine(rootPath, roleName, roleName)));
+ Assert.IsTrue(File.Exists(Path.Combine(rootPath, roleName, roleName, "manage.py")));
+ Assert.IsTrue(Directory.Exists(Path.Combine(rootPath, roleName, roleName, roleName)));
+ Assert.IsTrue(File.Exists(Path.Combine(rootPath, roleName, roleName, roleName, "__init__.py")));
+ Assert.IsTrue(File.Exists(Path.Combine(rootPath, roleName, roleName, roleName, "settings.py")));
+ Assert.IsTrue(File.Exists(Path.Combine(rootPath, roleName, roleName, roleName, "urls.py")));
+ Assert.IsTrue(File.Exists(Path.Combine(rootPath, roleName, roleName, roleName, "wsgi.py")));
}
}
View
15 WindowsAzurePowershell/src/Management.CloudService/Python/Cmdlet/AddAzureDjangoWebRole.cs
@@ -49,14 +49,23 @@ protected override void OnProcessing(RoleInfo roleInfo)
{
string stdOut, stdErr;
- ProcessHelper.StartAndWaitForProcess(
+ string originalDir = Directory.GetCurrentDirectory();
+ Directory.SetCurrentDirectory(Path.Combine(RootPath, roleInfo.Name));
+
+ try
+ {
+ ProcessHelper.StartAndWaitForProcess(
new ProcessStartInfo(
Path.Combine(interpPath, PythonInterpreterExe),
String.Format(DjangoStartProjectCommand, roleInfo.Name)
),
out stdOut,
- out stdErr
- );
+ out stdErr);
+ }
+ finally
+ {
+ Directory.SetCurrentDirectory(originalDir);
+ }
if (!string.IsNullOrEmpty(stdErr))
{
View
8 WindowsAzurePowershell/src/ServiceManagement/ResourceModel/ServiceManagementHelper.cs
@@ -263,6 +263,7 @@ public class ServiceManagementClientOutputMessageInspector : IClientMessageInspe
{
public const string UserAgentHeaderName = "User-Agent";
public const string UserAgentHeaderContent = "Windows Azure Powershell/v.0.6.9";
+ public const string VSDebuggerCausalityDataHeaderName = "VSDebuggerCausalityData";
#region IClientMessageInspector Members
@@ -272,6 +273,13 @@ public object BeforeSendRequest(ref Message request, IClientChannel channel)
if (request.Properties.ContainsKey(HttpRequestMessageProperty.Name))
{
var property = (HttpRequestMessageProperty)request.Properties[HttpRequestMessageProperty.Name];
+
+ // Remove VSDebuggerCausalityData header which is added by WCF.
+ if (property.Headers[VSDebuggerCausalityDataHeaderName] != null)
+ {
+ property.Headers.Remove(VSDebuggerCausalityDataHeaderName);
+ }
+
if (property.Headers[Constants.VersionHeaderName] == null)
{
property.Headers.Add(Constants.VersionHeaderName, Constants.VersionHeaderContent20120301);
Please sign in to comment.
Something went wrong with that request. Please try again.