mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
Rename "roles" to "units". Put units in their own folders.
This commit is contained in:
parent
7d9d64ddcb
commit
3a9b193f68
63 changed files with 105 additions and 105 deletions
20
lib/units/storage/plugins/image/task/get.js
Normal file
20
lib/units/storage/plugins/image/task/get.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
var util = require('util')
|
||||
var http = require('http')
|
||||
var url = require('url')
|
||||
|
||||
var Promise = require('bluebird')
|
||||
|
||||
module.exports = function(path, options) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
http.get(url.resolve(options.storageUrl, path))
|
||||
.on('response', function(res) {
|
||||
if (res.statusCode !== 200) {
|
||||
reject(new Error(util.format('HTTP %d', res.statusCode)))
|
||||
}
|
||||
else {
|
||||
resolve(res)
|
||||
}
|
||||
})
|
||||
.on('error', reject)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue