Commit e917bc29 authored by Richer Maximilien's avatar Richer Maximilien
Browse files

Merge branch 'fix_register_user_gox' into 'master'

[c] Fix cross-compilation for register command

This is a hotfix and should be pushed against v0.0.2

See merge request !38
parents 66c4467d e6b8e52d
Pipeline #350 passed with stages
...@@ -7,6 +7,8 @@ stages: ...@@ -7,6 +7,8 @@ stages:
Unit tests: Unit tests:
stage: test stage: test
except:
- /^[0-9]+\./
tags: tags:
- golang - golang
- mongo # Require an available mongo service - mongo # Require an available mongo service
...@@ -40,6 +42,8 @@ Unit tests: ...@@ -40,6 +42,8 @@ Unit tests:
Integration tests: Integration tests:
stage: test stage: test
except:
- /^[0-9]+\./
tags: tags:
- golang - golang
- mongo - mongo
...@@ -53,6 +57,8 @@ Integration tests: ...@@ -53,6 +57,8 @@ Integration tests:
Code lint: Code lint:
stage: test stage: test
except:
- /^[0-9]+\./
allow_failure: True allow_failure: True
tags: tags:
- golang - golang
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
osuser "os/user" osuser "os/user"
"strconv" "strconv"
"strings" "strings"
"time"
"dfss/dfssc/user" "dfss/dfssc/user"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
...@@ -20,17 +19,17 @@ func registerUser() { ...@@ -20,17 +19,17 @@ func registerUser() {
var country, mail, organization, unit, passphrase string var country, mail, organization, unit, passphrase string
var bits int var bits int
name := "Jon Doe"
u, err := osuser.Current() u, err := osuser.Current()
if err != nil { if err == nil {
fmt.Println("An error occurred : ", err.Error()) name = u.Name
return
} }
// Get all the necessary parameters // Get all the necessary parameters
readStringParam("Mail", "", &mail) readStringParam("Mail", "", &mail)
readStringParam("Country", time.Now().Location().String(), &country) readStringParam("Country", "FR", &country)
readStringParam("Organization", u.Name, &organization) readStringParam("Organization", name, &organization)
readStringParam("Organizational unit", u.Name, &unit) readStringParam("Organizational unit", name, &unit)
readIntParam("Length of the key (2048 or 4096)", "2048", &bits) readIntParam("Length of the key (2048 or 4096)", "2048", &bits)
err = readPassword(&passphrase, true) err = readPassword(&passphrase, true)
if err != nil { if err != nil {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment