Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
sanity clearance
Browse files Browse the repository at this point in the history
Removing old references and unused code
removing and sorting using statements
  • Loading branch information
astaykov committed Aug 29, 2013
1 parent 7e3f3c3 commit 4e4c5da
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 56 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Expand Up @@ -15,6 +15,10 @@ build/
[Bb]in/
[Oo]bj/

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

Expand Down Expand Up @@ -96,10 +100,6 @@ publish/
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef
Expand Down
5 changes: 2 additions & 3 deletions WorkerRole/Log.cs
Expand Up @@ -15,11 +15,10 @@
//
#endregion

using System;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.WindowsAzure.ServiceRuntime;
using System;

namespace WorkerRole
{
Expand Down
3 changes: 1 addition & 2 deletions WorkerRole/LogEntry.cs
Expand Up @@ -15,10 +15,9 @@
//
#endregion

using System;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using System;

namespace WorkerRole
{
Expand Down
41 changes: 7 additions & 34 deletions WorkerRole/RunMe.cs
Expand Up @@ -15,25 +15,21 @@
//
#endregion

using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.RetryPolicies;
using SevenZip;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Threading;
using System.Timers;
using System.Xml;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.Diagnostics.Management;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using SevenZip;
using Microsoft.WindowsAzure.StorageClient;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.RetryPolicies;


namespace WorkerRole
Expand All @@ -42,8 +38,6 @@ public class RunMe
{
Log log;

CloudDrive cloudDrive = null;

List<Process> processes = null;

bool isRoleStopping = false;
Expand All @@ -59,9 +53,6 @@ public class RunMe
const string PACKAGES = "Packages";
const string WORKING_DIRECTORY = "WorkingDirectory";
const string COMMANDS = "Commands";
const string CLOUD_DRIVE_CONNECTION_STRING = "CloudDriveConnectionString";
const string CLOUD_DRIVE = "CloudDrive";
const string CLOUD_DRIVE_SIZE = "CloudDriveSize";
const string DEFAULT_CONNECTION_LIMIT = "DefaultConnectionLimit";
const string LABEL = "Label";
const string UPDATE_INDICATOR = "UpdateIndicator";
Expand Down Expand Up @@ -117,9 +108,6 @@ private string ExpandKeywords(string buffer)
buffer = buffer.Replace("$roleroot$", Environment.GetEnvironmentVariable("RoleRoot"));
buffer = buffer.Replace("$version$", GetAzureRunMeVersion());

if (cloudDrive != null)
buffer = buffer.Replace("$clouddrive$", cloudDrive.LocalPath);

return buffer;
}

Expand Down Expand Up @@ -298,7 +286,6 @@ private Process Run(string workingDirectory, string environmentVariables, string
const string IP_ADDRESS = "ipaddress";
const string DEPLOYMENT_ID = "deploymentid";
const string ROLE_INSTANCE_ID = "roleinstanceid";
const string CLOUD_DRIVE = "clouddrive";

string command = Path.Combine(
workingDirectory,
Expand Down Expand Up @@ -334,11 +321,6 @@ private Process Run(string workingDirectory, string environmentVariables, string
SetEnvironmentVariable(startInfo, DEPLOYMENT_ID, RoleEnvironment.DeploymentId);
SetEnvironmentVariable(startInfo, ROLE_INSTANCE_ID, RoleEnvironment.CurrentRoleInstance.Id);

if (cloudDrive != null)
{
SetEnvironmentVariable(startInfo, CLOUD_DRIVE, cloudDrive.LocalPath);
}

Tracer.WriteLine(string.Format("Start Process {0}", command), "Information");

Process process = new Process()
Expand Down Expand Up @@ -544,14 +526,7 @@ public void Run()
log.WriteEntry("Stopping", "", GetLabel());
}

private void UnmountCloudDrive()
{
if (cloudDrive != null)
{
Tracer.WriteLine(string.Format("Unmounting {0} from {1}", cloudDrive.Uri, cloudDrive.LocalPath), "Information");
cloudDrive.Unmount();
}
}


public void OnStop()
{
Expand All @@ -563,8 +538,6 @@ public void OnStop()
string commands = RoleEnvironment.GetConfigurationSettingValue("OnStopCommands");
WaitForCommandsExit(RunCommands(commands));

UnmountCloudDrive();

Tracer.WriteLine("Stopped", "Critical");
log.WriteEntry("Stopped", "", GetLabel());
}
Expand Down
10 changes: 1 addition & 9 deletions WorkerRole/WorkerRole.cs
Expand Up @@ -15,16 +15,8 @@
//
#endregion

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Threading;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
using System;

namespace WorkerRole
{
Expand Down
4 changes: 0 additions & 4 deletions WorkerRole/WorkerRole.csproj
Expand Up @@ -38,10 +38,6 @@
<Reference Include="Microsoft.Data.OData, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.CloudDrive, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\v2.1\ref\Microsoft.WindowsAzure.CloudDrive.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
Expand Down

0 comments on commit 4e4c5da

Please sign in to comment.