1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00
OpenSTF/lib/units/device/resources/util/resource.js

21 lines
448 B
JavaScript

var util = require('util')
function Resource(options) {
this.src = options.src
this.dest = options.dest.shift()
this.comm = options.comm
this.mode = options.mode
this.fallback = options.dest
}
Resource.prototype.shift = function() {
if (this.fallback.length === 0) {
throw new Error(util.format(
'Out of fallback locations for "%s"'
, this.src
))
}
this.dest = this.fallback.shift()
}
module.exports = Resource