fix linting

This commit is contained in:
Arthur Lu 2023-12-15 08:14:39 +00:00
parent 7cb2893fc8
commit 7b0549e052
4 changed files with 9 additions and 9 deletions

View File

@ -100,7 +100,7 @@ router.post(`${basePath}/resources`, async (req, res) => {
request.cpu = params.proctype;
}
// 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.end();
return;
@ -201,7 +201,7 @@ router.post(`${basePath}/create`, async (req, res) => {
}
}
// 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.end();
return;

View File

@ -155,7 +155,7 @@ router.post("/:disk/resize", async (req, res) => {
const request = {};
request[storage] = Number(params.size * 1024 ** 3); // setup request object
// 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.end();
return;
@ -215,7 +215,7 @@ router.post("/:disk/move", async (req, res) => {
request[dstStorage] = Number(size); // always decrease destination storage by size
}
// 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.end();
return;
@ -331,7 +331,7 @@ router.post("/:disk/create", async (req, res) => {
// setup request
request[params.storage] = Number(params.size * 1024 ** 3);
// 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.end();
return;

View File

@ -57,7 +57,7 @@ router.post("/:netid/create", async (req, res) => {
network: Number(params.rate)
};
// 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.end();
return;
@ -122,7 +122,7 @@ router.post("/:netid/modify", async (req, res) => {
network: Number(params.rate) - Number(currentNetworkRate)
};
// 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.end();
return;

View File

@ -108,7 +108,7 @@ router.post("/:hostpci/modify", async (req, res) => {
const deviceData = await getDeviceInfo(params.node, params.device);
const request = { pci: deviceData.device_name };
// 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.end();
return;
@ -189,7 +189,7 @@ router.post("/create", async (req, res) => {
pci: deviceData.device_name
};
// 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.end();
return;