Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Leveraging blockchain usage to enhance slag exchange
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HyperCOG public
Leveraging blockchain usage to enhance slag exchange
Commits
01392dae
Commit
01392dae
authored
3 years ago
by
Gomez Goiri, Aitor
Browse files
Options
Downloads
Patches
Plain Diff
Fixing await related issues in user generation script
parent
20c00c3c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/create-users.js
+5
-4
5 additions, 4 deletions
scripts/create-users.js
with
5 additions
and
4 deletions
scripts/create-users.js
+
5
−
4
View file @
01392dae
...
...
@@ -33,7 +33,7 @@ const modifyUser = async (
return
modUser
}
const
createOrModifyUserIfNeeded
=
(
const
createOrModifyUserIfNeeded
=
async
(
apiClient
,
username
,
password
,
...
...
@@ -42,7 +42,7 @@ const createOrModifyUserIfNeeded = (
)
=>
{
try
{
// Await is needed here to force the catch clausule if something goes wrong
return
apiClient
.
createUser
(
return
await
apiClient
.
createUser
(
username
,
password
,
organization
,
...
...
@@ -62,7 +62,8 @@ const createUsers = async () => {
process
.
env
.
TRACEBLOCK_CHAINCODE
)
Object
.
entries
(
usersByOrg
).
forEach
(
async
([
org
,
values
])
=>
{
for
(
let
el
of
Object
.
entries
(
usersByOrg
))
{
const
[
org
,
values
]
=
el
const
admin
=
values
.
find
(
v
=>
v
.
role
===
"
admin
"
)
await
apiClient
.
signIn
(
admin
.
user
,
readPassword
(
admin
.
user
,
org
),
org
)
...
...
@@ -81,7 +82,7 @@ const createUsers = async () => {
)
await
Promise
.
all
(
prom
)
}
)
}
console
.
log
(
"
Users created
"
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment