[fuchsia] remove no devices found from ffx parsing (#77651)

This commit is contained in:
omerlevran46
2021-03-15 10:58:05 -07:00
committed by GitHub
parent 59ea6192c6
commit c94648f9cc
4 changed files with 81 additions and 10 deletions

View File

@@ -395,7 +395,6 @@ class FuchsiaDeviceDiscovery implements DeviceDiscovery {
final Map<String, HealthCheckResult> results = <String, HealthCheckResult>{};
for (final String deviceId in await discoverDevices()) {
try {
StringBuffer stderr;
final int resolveResult = await exec(
_ffx,
<String>[
@@ -404,11 +403,9 @@ class FuchsiaDeviceDiscovery implements DeviceDiscovery {
'--format',
'a',
deviceId,
],
stderr: stderr
]
);
final String stderrOutput = stderr.toString().trim();
if (resolveResult == 0 && ! stderrOutput.contains('No devices found')) {
if (resolveResult == 0) {
results['fuchsia-device-$deviceId'] = HealthCheckResult.success();
} else {
results['fuchsia-device-$deviceId'] = HealthCheckResult.failure('Cannot resolve device $deviceId');

View File

@@ -322,7 +322,6 @@ Future<int> exec(
List<String> arguments, {
Map<String, String> environment,
bool canFail = false, // as in, whether failures are ok. False means that they are fatal.
StringBuffer stderr, // if not null, the stderr will be written here
String workingDirectory,
}) async {
return _execute(
@@ -330,7 +329,6 @@ Future<int> exec(
arguments,
environment: environment,
canFail : canFail,
stderr: stderr,
workingDirectory: workingDirectory,
);
}