Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CFE-4414: cf-net connect now exits with 1 in case of error #5673

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

larsewi
Copy link
Contributor

@larsewi larsewi commented Jan 3, 2025

$ sudo /var/cfengine/bin/cf-net -H 192.168.123.456 connect
Failed to connect to '192.168.123.456'
$ echo $?
1
$ sudo /var/cfengine/bin/cf-net -H 127.0.0.1 connect
Connected & authenticated successfully to '127.0.0.1'
$ echo $?
0

```
$ sudo /var/cfengine/bin/cf-net -H 192.168.123.456 connect
Failed to connect to '192.168.123.456'
$ echo $?
1
$ sudo /var/cfengine/bin/cf-net -H 127.0.0.1 connect
Connected & authenticated successfully to '127.0.0.1'
$ echo $?
0
```

Ticket: CFE-4414
Changelog: Title
Signed-off-by: Lars Erik Wik <[email protected]>
@larsewi larsewi changed the title cf-net connect now exits with 1 in case of error CFE-4414: cf-net connect now exits with 1 in case of error Jan 3, 2025
@larsewi larsewi marked this pull request as ready for review January 3, 2025 09:46
@larsewi
Copy link
Contributor Author

larsewi commented Jan 3, 2025

@cf-bottom Jenkins please :)

@cf-bottom
Copy link

cf-net/cf-net.c Show resolved Hide resolved
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -472,7 +472,9 @@ static int CFNetRun(CFNetOptions *opts, char **args, char *hostnames)
int ret = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ret was not set to anything else than 0 before? Weird that we haven't been getting any warning/errors for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess because we return ret in the end.

@larsewi larsewi merged commit c234c2a into cfengine:master Jan 6, 2025
11 checks passed
@larsewi larsewi deleted the connect branch January 13, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants