File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -30,23 +30,26 @@ if ! [ -f "$CONFIG" ]; then
3030fi
3131
3232# Fetch Authentication token and server from Mender Auth Manager.
33- DBUS_REPLY=" $( dbus-send \
34- --system \
35- --print-reply \
36- --dest=io.mender.AuthenticationManager \
37- /io/mender/AuthenticationManager \
38- io.mender.Authentication1.GetJwtToken \
39- | sed -ne ' /^ *string ".*" *$/ {s/^ *string "\(.*\)" *$/\1/; p}' ) "
33+ DBUS_RAW=$( dbus-send \
34+ --system \
35+ --print-reply \
36+ --dest=io.mender.AuthenticationManager \
37+ /io/mender/AuthenticationManager \
38+ io.mender.Authentication1.GetJwtToken)
39+
40+ DBUS_REPLY=$( echo " $DBUS_RAW " | sed -ne ' /^ *string ".*" *$/ {s/^ *string "\(.*\)" *$/\1/; p}' )
4041
4142AUTH_TOKEN=" $( echo " $DBUS_REPLY " | sed -ne ' 1p' ) "
4243SERVER=" $( echo " $DBUS_REPLY " | sed -ne ' 2p' ) "
4344
4445if [ -z " $AUTH_TOKEN " ]; then
45- echo " An authentication token could not be obtained over DBus."
46- exit 1
46+ echo " mender-inventory-mender-configure: An authentication token could not be obtained over DBus."
47+ # Don't produce an error. Most likely mender-auth is not ready or
48+ # the device hasn't been accepted
49+ exit 0
4750fi
4851if [ -z " $SERVER " ]; then
49- echo " A server address could not be obtained over DBus."
52+ echo " mender-inventory-mender-configure: A server address could not be obtained over DBus."
5053 exit 1
5154fi
5255
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ testInvalidEndpoint() {
7676testMissingJwtToken () {
7777 export TEST_AUTH_TOKEN_EMPTY=1
7878 output=" $( " ${inv_script} " ) "
79- assertNotEquals 0 $?
79+ assertEquals 0 $?
8080 assertEquals " " " ${output} "
8181 assertEquals " " " $( cat " $TEST_HTTP_LOG " 2> /dev/null) "
8282}
You can’t perform that action at this time.
0 commit comments