Skip to content

Commit b4ac359

Browse files
Fix linting.
1 parent 5c2d6f0 commit b4ac359

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

lib/virtualbox.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,15 @@ class Virtualbox {
8282
this._executor,
8383
this._vBoxManageBinary
8484
);
85+
this.vboxmanage = defaultvboxmanage;
86+
this.SCAN_CODES = require('./scan-codes');
8587
}
8688

8789
static create(logging, executor) {
8890
const logger = !!logging ? logging : defaultLogger;
8991
return new Virtualbox(logger, executor);
9092
}
9193

92-
vboxmanage = defaultvboxmanage;
93-
SCAN_CODES = require('./scan-codes');
94-
9594
pause(vmname, callback) {
9695
this._logging.info('Pausing VM "%s"', vmname);
9796
this.vboxmanage(['controlvm', vmname, 'pause'], function (error, _) {
@@ -457,10 +456,10 @@ class Virtualbox {
457456
options.run,
458457
image_name = options.image_name || path;
459458

460-
this.guestproperty.os(vm, function (os_type) {
459+
this.guestproperty.os(vm, (os_type) => {
461460
switch (os_type) {
462461
case known_OS_types.WINDOWS:
463-
exec(
462+
this._executor(
464463
{
465464
vm: vm,
466465
user: options.user,
@@ -473,7 +472,7 @@ class Virtualbox {
473472
break;
474473
case known_OS_types.MAC:
475474
case known_OS_types.LINUX:
476-
exec(
475+
this._executor(
477476
{
478477
vm: vm,
479478
user: options.user,
@@ -527,22 +526,21 @@ class VboxStorage {
527526
this._logging = logging;
528527
this._executor = executor;
529528
this._vBoxManageBinary = vBoxManageBinary;
529+
this.vboxmanage = defaultvboxmanage;
530530
}
531531

532-
vboxmanage = defaultvboxmanage;
533-
534532
addCtl(options, callback) {
535533
var vm = options.vm || options.name || options.vmname || options.title,
536534
device_name = options.perhiperal_name || 'IDE',
537535
type = options.type || 'ide';
538-
logging.info(
536+
this._logging.info(
539537
'Adding "%s" controller named "%s" to %s',
540538
type,
541539
device_name,
542540
vm
543541
);
544542
var cmd = ['storagectl', vm, '--name', device_name, '--add', type];
545-
vboxmanage(cmd, callback);
543+
this.vboxmanage(cmd, callback);
546544
}
547545

548546
attach(options, callback) {
@@ -552,7 +550,7 @@ class VboxStorage {
552550
device = options.device || '0',
553551
type = options.type || 'dvddrive',
554552
medium = options.medium;
555-
logging.info(
553+
this._logging.info(
556554
'Mounting "%s" to controller named "%s" on %s',
557555
medium,
558556
device_name,
@@ -572,7 +570,7 @@ class VboxStorage {
572570
'--medium',
573571
medium,
574572
];
575-
vboxmanage(cmd, callback);
573+
this.vboxmanage(cmd, callback);
576574
}
577575
}
578576

@@ -582,10 +580,9 @@ class VboxGuestProperty {
582580
this._executor = executor;
583581
this._vBoxManageBinary = vBoxManageBinary;
584582
this.os_type = null;
583+
this.vboxmanage = defaultvboxmanage;
585584
}
586585

587-
vboxmanage = defaultvboxmanage;
588-
589586
get(options, callback) {
590587
var vm = options.vm || options.name || options.vmname || options.title,
591588
key = options.key,
@@ -703,10 +700,9 @@ class VboxExtraData {
703700
this._logging = logging;
704701
this._executor = executor;
705702
this._vBoxManageBinary = vBoxManageBinary;
703+
this.vboxmanage = defaultvboxmanage;
706704
}
707705

708-
vboxmanage = defaultvboxmanage;
709-
710706
get(options, callback) {
711707
var vm = options.vm || options.name || options.vmname || options.title,
712708
key = options.key,

package-lock.json

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"devDependencies": {
7272
"async": "^2.1.4",
7373
"jest": "^26.0.1",
74-
"jshint": "^2.10.2"
74+
"jshint": "^2.12.0"
7575
},
7676
"engines": {
7777
"engine": "node >= 0.4.1"

test/integration/export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var virtualbox = require('../../lib/virtualbox'),
44
vmName = 'node-virtualbox-test-machine';
55

6-
virtualbox.export(args[0], args[1], function (error) {
6+
virtualbox.export(vmName, 'test-export', function (error) {
77
if (error) {
88
throw error;
99
}

test/integration/getextradata.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
'use strict';
22

33
var virtualbox = require('../../lib/virtualbox'),
4-
vmName = 'node-virtualbox-test-machine';
4+
vmname = 'node-virtualbox-test-machine',
5+
key = 'some-data-key';
56

6-
virtualbox.extradata.get({ vm: args[0], key: args[1] }, function (
7-
error,
8-
value
9-
) {
7+
virtualbox.extradata.get({ vmname, key }, function (error, value) {
108
if (error) {
119
throw error;
1210
}
1311

1412
console.log(
1513
'Virtual Machine "%s" extra "%s" value is "%s"',
16-
args[0],
17-
args[1],
14+
vmname,
15+
key,
1816
value
1917
);
2018
});

0 commit comments

Comments
 (0)