Skip to content

Commit

Permalink
fix some Logger imports from cli/kibana_keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Aug 6, 2020
1 parent 7e72fde commit 1decf87
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/cli_keystore/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';
import { confirm, question } from '../legacy/server/utils';
import { createPromiseFromStreams, createConcatStream } from '../legacy/utils';

Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { PassThrough } from 'stream';

import { Keystore } from '../legacy/server/keystore';
import { add } from './add';
import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';
import * as prompt from '../legacy/server/utils/prompt';

describe('Kibana keystore', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';
import { confirm } from '../legacy/server/utils';

export async function create(keystore, command, options) {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import sinon from 'sinon';

import { Keystore } from '../legacy/server/keystore';
import { create } from './create';
import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';
import * as prompt from '../legacy/server/utils/prompt';

describe('Kibana keystore', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/get_keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { existsSync } from 'fs';
import { join } from 'path';

import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';
import { getConfigDirectory, getDataPath } from '../core/server/path';

export function getKeystore() {
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/get_keystore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { getKeystore } from './get_keystore';
import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';
import fs from 'fs';
import sinon from 'sinon';

Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';

export function list(keystore, command, options = {}) {
const logger = new Logger(options);
Expand Down
2 changes: 1 addition & 1 deletion src/cli_keystore/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jest.mock('fs', () => ({
import sinon from 'sinon';
import { Keystore } from '../legacy/server/keystore';
import { list } from './list';
import Logger from '../cli_plugin/lib/logger';
import { Logger } from '../cli_plugin/lib/logger';

describe('Kibana keystore', () => {
describe('list', () => {
Expand Down
8 changes: 5 additions & 3 deletions src/cli_plugin/install/download.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
* under the License.
*/

import Fs from 'fs';
import { join } from 'path';
import http from 'http';

import sinon from 'sinon';
import nock from 'nock';
import glob from 'glob-all';
import del from 'del';
import Fs from 'fs';

import { Logger } from '../lib/logger';
import { UnsupportedProtocolError } from '../lib/errors';
import { download, _downloadSingle, _getFilePath, _checkFilePathDeprecation } from './download';
import { join } from 'path';
import http from 'http';

describe('kibana cli', function () {
describe('plugin downloader', function () {
Expand Down
1 change: 1 addition & 0 deletions src/cli_plugin/install/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import sinon from 'sinon';

import { installCommand } from './index';

describe('kibana cli', function () {
Expand Down
6 changes: 3 additions & 3 deletions src/cli_plugin/install/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@

import Fs from 'fs';
import { promisify } from 'util';
import path from 'path';

import del from 'del';

import { download } from './download';
import path from 'path';
import { cleanPrevious, cleanArtifacts } from './cleanup';
import { extract, getPackData } from './pack';
import { renamePlugin } from './rename';
import del from 'del';
import { errorIfXPackInstall } from '../lib/error_if_x_pack';
import { existingInstall, assertVersion } from './kibana';

Expand Down Expand Up @@ -57,7 +58,6 @@ export async function install(settings, logger) {
logger.log('Plugin installation complete');
} catch (err) {
logger.error(`Plugin installation was unsuccessful due to error "${err.message}"`);
console.error(err);
cleanArtifacts(settings);
process.exit(70);
}
Expand Down
3 changes: 2 additions & 1 deletion src/cli_plugin/install/kibana.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
*/

import path from 'path';
import { versionSatisfies, cleanVersion } from '../../legacy/utils/version';
import { statSync } from 'fs';

import { versionSatisfies, cleanVersion } from '../../legacy/utils/version';

export function existingInstall(settings, logger) {
try {
statSync(path.join(settings.pluginDir, settings.plugins[0].id));
Expand Down
8 changes: 5 additions & 3 deletions src/cli_plugin/install/kibana.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
* under the License.
*/

import sinon from 'sinon';
import { Logger } from '../lib/logger';
import { join } from 'path';
import del from 'del';
import fs from 'fs';

import sinon from 'sinon';
import del from 'del';

import { existingInstall, assertVersion } from './kibana';
import { Logger } from '../lib/logger';

jest.spyOn(fs, 'statSync');

Expand Down
3 changes: 2 additions & 1 deletion src/cli_plugin/install/pack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
*/

import Fs from 'fs';
import { join } from 'path';

import sinon from 'sinon';
import glob from 'glob-all';
import del from 'del';

import { Logger } from '../lib/logger';
import { extract, getPackData } from './pack';
import { _downloadSingle } from './download';
import { join } from 'path';

describe('kibana cli', function () {
describe('pack', function () {
Expand Down
1 change: 1 addition & 0 deletions src/cli_plugin/install/rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { rename } from 'fs';

import { delay } from 'lodash';

export function renamePlugin(workingPath, finalPath) {
Expand Down
3 changes: 2 additions & 1 deletion src/cli_plugin/install/rename.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
* under the License.
*/

import sinon from 'sinon';
import fs from 'fs';

import sinon from 'sinon';

import { renamePlugin } from './rename';

describe('plugin folder rename', function () {
Expand Down
4 changes: 3 additions & 1 deletion src/cli_plugin/install/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
* under the License.
*/

import expiry from 'expiry-js';
import { resolve } from 'path';

import expiry from 'expiry-js';

import { fromRoot } from '../../core/server/utils';

function generateUrls({ version, plugin }) {
Expand Down
6 changes: 4 additions & 2 deletions src/cli_plugin/install/zip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
* under the License.
*/

import del from 'del';
import path from 'path';
import os from 'os';
import glob from 'glob';
import fs from 'fs';

import del from 'del';
import glob from 'glob';

import { analyzeArchive, extractArchive } from './zip';

const getMode = (path) => (fs.statSync(path).mode & parseInt('777', 8)).toString(8);
Expand Down
1 change: 1 addition & 0 deletions src/cli_plugin/lib/logger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import sinon from 'sinon';

import { Logger } from './logger';

describe('kibana cli', function () {
Expand Down
6 changes: 4 additions & 2 deletions src/cli_plugin/list/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
* under the License.
*/

import del from 'del';
import { list } from './list';
import { join } from 'path';
import { writeFileSync, mkdirSync } from 'fs';

import del from 'del';

import { list } from './list';

function createPlugin(name, version, pluginBaseDir) {
const pluginDir = join(pluginBaseDir, name);
mkdirSync(pluginDir, { recursive: true });
Expand Down
3 changes: 2 additions & 1 deletion src/cli_plugin/remove/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
*/

import { statSync } from 'fs';
import { errorIfXPackRemove } from '../lib/error_if_x_pack';

import del from 'del';

import { errorIfXPackRemove } from '../lib/error_if_x_pack';

export function remove(settings, logger) {
try {
let stat;
Expand Down

0 comments on commit 1decf87

Please sign in to comment.