linode / cli

This is the DEPRECATED Linode CLI. Use https://github.com/linode/linode-cli
https://www.linode.com/docs/platform/linode-cli
Other
466 stars 36 forks source link

Can't set MX priority to zero #61

Closed petertwise closed 6 years ago

petertwise commented 7 years ago

Hi -

I've tried the following:

linode domain record-create -l example.com -t MX -R example.mail.protection.outlook.com. -P 0

linode domain record-create -l example.com -t MX -R example.mail.protection.outlook.com. -P '0'

linode domain record-create -l example.com -t MX -R example.mail.protection.outlook.com. -P "0"

linode domain record-create -l example.com -t MX -R example.mail.protection.outlook.com. --priority 0

All result in the default priority level of 10 being set.

Not really a big deal as usually setting a priority level of 1 instead of 0 will suffice.

But it's possible to set it to zero in the GUI so I thought I would bring it up here.

petertwise commented 7 years ago

Ternary logic in /lib/Linode/CLI/Object/Domain.pm line 506 will interpret 0 as false. Should probably check if the value is NULL or empty instead.

displague commented 6 years ago

Thanks for reporting this, @squarecandy.

This cli is deprecated in favor of https://github.com/linode/linode-cli (pip install linode-cli).

The interface is very similar, but you will need to modify the command a little:

$ linode-cli domains list # get the DOMAIN_ID you want to modify
$ linode-cli domains records-create  $DOMAIN_ID --name "" \
  --type MX --target example.mail.protection.outlook.com. --priority 0
┌─────────────┬──────┬──────┬─────────────────────────────────────┬─────────┬──────────┬────────┐
│ id          │ type │ name │ target                              │ ttl_sec │ priority │ weight │
├─────────────┼──────┼──────┼─────────────────────────────────────┼─────────┼──────────┼────────┤
│ <DOMAIN_ID> │ MX   │      │ example.mail.protection.outlook.com │ 0       │ 0        │ 0      │
└─────────────┴──────┴──────┴─────────────────────────────────────┴─────────┴──────────┴────────┘