Remove azdata eula acceptance from arc deployments (#12292)

* saving to switch tasks

* activate to exports in extApi

* working version - cleanup pending

* improve messages

* apply pr feedback from a different review

* remove unneeded strings

* redo apiService

* remove async from getVersionFromOutput

* remove _ prefix from protected fields

* error message fix

* throw specif errors from azdata extension

* arrow methods to regular methods

* pr feedback

* expand azdata extension api

* pr feedback

* remove unused var

* pr feedback
This commit is contained in:
Arvind Ranasaria
2020-09-17 11:20:32 -07:00
committed by GitHub
parent 945e04ed92
commit ba44a2f02e
17 changed files with 181 additions and 114 deletions

View File

@@ -8,10 +8,11 @@ import { SemVer } from 'semver';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { AzdataInstallLocationKey, DeploymentConfigurationKey } from '../../constants';
import { Command, OsDistribution, ToolType } from '../../interfaces';
import { Command, OsDistribution, ToolStatus, ToolType } from '../../interfaces';
import { apiService } from '../apiService';
import { IPlatformService } from '../platformService';
import { dependencyType, ToolBase } from './toolBase';
import { SemVerProxy } from './SemVerProxy';
import * as loc from '../../localizedConstants';
const localize = nls.loadMessageBundle();
export const AzdataToolName = 'azdata';
@@ -44,25 +45,57 @@ export class AzdataTool extends ToolBase {
return 'https://docs.microsoft.com/sql/big-data-cluster/deploy-install-azdata';
}
public validateEula(): boolean {
if (apiService.azdataApi.isEulaAccepted()) {
return true;
} else {
this.setStatusDescription(loc.azdataEulaNotAccepted);
return false;
}
}
/* unused */
protected get versionCommand(): Command {
return {
command: 'azdata -v'
command: ''
};
}
/* unused */
protected get discoveryCommand(): Command {
return {
command: this.discoveryCommandString('azdata')
command: ''
};
}
/**
* updates the version and status for the tool.
*/
protected async updateVersionAndStatus(): Promise<void> {
this.setStatusDescription('');
await this.addInstallationSearchPathsToSystemPath();
const commandOutput = await apiService.azdataApi.azdata.version();
this.version = apiService.azdataApi.azdata.getSemVersion();
if (this.version) {
if (this.autoInstallSupported) {
// set the installationPath
this.setInstallationPathOrAdditionalInformation(apiService.azdataApi.azdata.getPath());
}
this.setStatus(ToolStatus.Installed);
}
else {
this.setInstallationPathOrAdditionalInformation(localize('deployCluster.GetToolVersionErrorInformation', "Error retrieving version information. See output channel '{0}' for more details", this.outputChannelName));
this.setStatusDescription(localize('deployCluster.GetToolVersionError', "Error retrieving version information.{0}Invalid output received, get version command output: '{1}' ", EOL, commandOutput.stderr.join(EOL)));
this.setStatus(ToolStatus.NotInstalled);
}
}
protected getVersionFromOutput(output: string): SemVer | undefined {
let version: SemVer | undefined = undefined;
if (output && output.split(EOL).length > 0) {
version = new SemVerProxy(output.split(EOL)[0].replace(/ /g, ''));
}
return version;
return apiService.azdataApi.azdata.getSemVersion();
}
protected async getSearchPaths(): Promise<string[]> {
switch (this.osDistribution) {
case OsDistribution.win32: