fix linting
This commit is contained in:
parent
3d746791e3
commit
c801ca99df
@ -100,7 +100,7 @@ router.post(`${basePath}/resources`, async (req, res) => {
|
|||||||
request.cpu = params.proctype;
|
request.cpu = params.proctype;
|
||||||
}
|
}
|
||||||
// check resource approval
|
// check resource approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: "Could not fulfil request." });
|
res.status(500).send({ request, error: "Could not fulfil request." });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
@ -201,7 +201,7 @@ router.post(`${basePath}/create`, async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check resource approval
|
// check resource approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) { // check resource approval
|
if (!await approveResources(req, req.cookies.username, request, params.node)) { // check resource approval
|
||||||
res.status(500).send({ request, error: "Not enough resources to satisfy request." });
|
res.status(500).send({ request, error: "Not enough resources to satisfy request." });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
|
@ -155,7 +155,7 @@ router.post("/:disk/resize", async (req, res) => {
|
|||||||
const request = {};
|
const request = {};
|
||||||
request[storage] = Number(params.size * 1024 ** 3); // setup request object
|
request[storage] = Number(params.size * 1024 ** 3); // setup request object
|
||||||
// check request approval
|
// check request approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Storage ${storage} could not fulfill request of size ${params.size}G.` });
|
res.status(500).send({ request, error: `Storage ${storage} could not fulfill request of size ${params.size}G.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
@ -215,7 +215,7 @@ router.post("/:disk/move", async (req, res) => {
|
|||||||
request[dstStorage] = Number(size); // always decrease destination storage by size
|
request[dstStorage] = Number(size); // always decrease destination storage by size
|
||||||
}
|
}
|
||||||
// check request approval
|
// check request approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Storage ${params.storage} could not fulfill request of size ${params.size}G.` });
|
res.status(500).send({ request, error: `Storage ${params.storage} could not fulfill request of size ${params.size}G.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
@ -331,7 +331,7 @@ router.post("/:disk/create", async (req, res) => {
|
|||||||
// setup request
|
// setup request
|
||||||
request[params.storage] = Number(params.size * 1024 ** 3);
|
request[params.storage] = Number(params.size * 1024 ** 3);
|
||||||
// check request approval
|
// check request approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Storage ${params.storage} could not fulfill request of size ${params.size}G.` });
|
res.status(500).send({ request, error: `Storage ${params.storage} could not fulfill request of size ${params.size}G.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
|
@ -57,7 +57,7 @@ router.post("/:netid/create", async (req, res) => {
|
|||||||
network: Number(params.rate)
|
network: Number(params.rate)
|
||||||
};
|
};
|
||||||
// check resource approval
|
// check resource approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Could not fulfil network request of ${params.rate}MB/s.` });
|
res.status(500).send({ request, error: `Could not fulfil network request of ${params.rate}MB/s.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
@ -122,7 +122,7 @@ router.post("/:netid/modify", async (req, res) => {
|
|||||||
network: Number(params.rate) - Number(currentNetworkRate)
|
network: Number(params.rate) - Number(currentNetworkRate)
|
||||||
};
|
};
|
||||||
// check resource approval
|
// check resource approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Could not fulfil network request of ${params.rate}MB/s.` });
|
res.status(500).send({ request, error: `Could not fulfil network request of ${params.rate}MB/s.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
|
@ -108,7 +108,7 @@ router.post("/:hostpci/modify", async (req, res) => {
|
|||||||
const deviceData = await getDeviceInfo(params.node, params.device);
|
const deviceData = await getDeviceInfo(params.node, params.device);
|
||||||
const request = { pci: deviceData.device_name };
|
const request = { pci: deviceData.device_name };
|
||||||
// check resource approval
|
// check resource approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Could not fulfil request for ${deviceData.device_name}.` });
|
res.status(500).send({ request, error: `Could not fulfil request for ${deviceData.device_name}.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
@ -189,7 +189,7 @@ router.post("/create", async (req, res) => {
|
|||||||
pci: deviceData.device_name
|
pci: deviceData.device_name
|
||||||
};
|
};
|
||||||
// check resource approval
|
// check resource approval
|
||||||
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
if (!await approveResources(req, req.cookies.username, request, params.node)) {
|
||||||
res.status(500).send({ request, error: `Could not fulfil request for ${deviceData.device_name}.` });
|
res.status(500).send({ request, error: `Could not fulfil request for ${deviceData.device_name}.` });
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user