-
Notifications
You must be signed in to change notification settings - Fork 21
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
InABox: Add support for /region alias for /datacentre #236
base: main
Are you sure you want to change the base?
Conversation
b16fc6e
to
564a872
Compare
lib/Synergy/Reactor/InABox.pm
Outdated
@@ -159,15 +159,23 @@ command box => { | |||
|
|||
my %switches = map { my ($k, @rest) = @$_; $k => \@rest } @$switches; | |||
|
|||
if (!exists $switches{datacentre}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the end goal here is that datacentre, datacenter, and region all mean the same thing, and providing more than 1 of them is a mistake. I think we can simplify this greatly with:
my @got = grep { exists $switches{$_} } qw(datacenter datacentre region);
if (@got > 1) {
die "The following options are mutually exclusive: @got\n";
}
$switches{datacentre} = delete $switches{$got[0]};
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that looks much cleaner! Let me test if this works in all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this and slightly adjusted it to make it all work nicely.
542b6ec
to
091bf32
Compare
d84d769
to
33e8ab1
Compare
747f6ee
to
10212ce
Compare
I always type "/region" on the first try because I've spent too much time in the cloud so region is the natural concept in my head rather than datacentre. So let's make the robot accomodate the human.
33e8ab1
to
c18948f
Compare
@rjbs I have applied your suggestions, rebased, and gave it a very rudimentary test-drive. |
@lerlacher-fm Thanks for humoring me, change looks good (and did indeed drop some complexity imho). 👍🏽 |
I always type "/region" on the first try because I've spent too much time in the cloud so region is the natural concept in my head rather than datacentre. So let's make the robot accomodate the human.