File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,18 @@ public static string GetDeviceName()
118118 //WIN-230 - Set DeviceName to Environment.MachineName.
119119 deviceName = Environment . MachineName ;
120120
121+ var isDefaultDeviceNameEc2 = IsEc2MachineName ( deviceName ) ;
122+
123+ if ( Config . IsEc2 == null || Config . IsEc2 == true || isDefaultDeviceNameEc2 )
124+ {
125+ var instanceID_task = GetEC2InstanceId ( ) ;
126+ instanceID_task . Wait ( ) ;
127+ if ( string . IsNullOrWhiteSpace ( instanceID_task . Result ) == false )
128+ {
129+ deviceName = instanceID_task . Result ;
130+ }
131+ }
132+
121133 return deviceName . Substring ( 0 , deviceName . Length > 60 ? 60 : deviceName . Length ) ;
122134 }
123135
@@ -192,6 +204,18 @@ public static string GetDeviceName()
192204 //WIN-230 - Set DeviceName to Environment.MachineName.
193205 deviceName = Environment . MachineName ;
194206
207+ var isDefaultDeviceNameEc2 = IsEc2MachineName ( deviceName ) ;
208+
209+ if ( Config . IsEc2 == null || Config . IsEc2 == true || isDefaultDeviceNameEc2 )
210+ {
211+ var instanceID_task = GetEC2InstanceId ( ) ;
212+ instanceID_task . Wait ( ) ;
213+ if ( string . IsNullOrWhiteSpace ( instanceID_task . Result ) == false )
214+ {
215+ deviceName = instanceID_task . Result ;
216+ }
217+ }
218+
195219 return deviceName . Substring ( 0 , deviceName . Length > 60 ? 60 : deviceName . Length ) ;
196220 }
197221
You can’t perform that action at this time.
0 commit comments