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

RbxCloud: Add support for FreeBSD #464

Merged
merged 4 commits into from
Jun 29, 2020
Merged

RbxCloud: Add support for FreeBSD #464

merged 4 commits into from
Jun 29, 2020

Conversation

ad-m
Copy link
Contributor

@ad-m ad-m commented Jun 29, 2020

Changes are made that simplify code and aim to properly support FreeBSD:

  • use util.find_devs_with instead call directly blkid, because on FreeBSD is not supported well and util.find_devs_with have solution for FreeBSD for that
  • introduction of an additional name on FAT file system, which is used in FreeBSD
  • drop shell to use default value, because FreeBSD – by default – does not have /bin/bash

Copy link
Collaborator

@igalic igalic left a comment

Choose a reason for hiding this comment

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

Good catch!

for dev, bdata in util.blkid().items()
if bdata.get('LABEL', '').upper() == 'CLOUDMD'
]
devices = util.find_devs_with('LABEL=CLOUDMD')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a small change in behaviour on Linux-based systems: the previous code would match 'CLOUDMD' case-insensitively, whereas the new code requires upper-case:

$ ls /dev/disk/by-label -lah
...
lrwxrwxrwx 1 root root  15 Jun 29 08:38  SYSTEM -> ../../nvme0n1p1
...
$ python3 -c 'from cloudinit import util; print(util.find_devs_with("LABEL=system"))'
[]
$ python3 -c 'from cloudinit import util; print(util.find_devs_with("LABEL=SYSTEM"))'
['/dev/nvme0n1p1']

Is this an issue, practically speaking?

(If this change is acceptable, we should also update ds-identify to match the more stringent case requirements.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In our environment, we've been providing clients with images only marked as CLOUDMD for years. The documentation in this area was also consistent always. I have not encountered (but we have no right to scan customer environments) a different situation.

I wonder at what stage the case insensitivity should be implemented. I notice that:

At the same time:

Considering diversity, it will adapt code of datasource to support both formats nor utils itself.

@OddBloke OddBloke self-assigned this Jun 29, 2020
Copy link
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants