Skip to content

cc_seed_random: update documentation and fix integration test#771

Merged
OddBloke merged 1 commit into
canonical:masterfrom
OddBloke:cc_seed_random
Jan 13, 2021
Merged

cc_seed_random: update documentation and fix integration test#771
OddBloke merged 1 commit into
canonical:masterfrom
OddBloke:cc_seed_random

Conversation

@OddBloke
Copy link
Copy Markdown
Collaborator

Proposed Commit Message

cc_seed_random: update documentation and fix integration test

The documentation did not mention that the given data may not be the
exact string written: the cloud's random data may be added to it.
Additionally, the documentation of the command key was incorrect.

test_seed_random_data was updated to check that the given data is a
prefix of the written data, to match cloud-init's expected (and, now,
documented) behaviour.

LP: #1911227

Test Steps

Run CLOUD_INIT_PLATFORM=azure pytest tests/integration_tests/modules/test_seed_random_data.py and observe a pass (vs. a fail previously).

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

Copy link
Copy Markdown
Collaborator

@smoser smoser left a comment

Choose a reason for hiding this comment

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

I'm good with this as it is or with any amount of my feedback taken. (But I do think the paren are not necessary 😉).

Comment thread cloudinit/config/cc_seed_random.py Outdated
the data to be written. The command should be specified as a list of args in
the ``command`` key. If a command is specified that cannot be run, no error
will be reported unless ``command_required`` is set to true.
A command can be specified (which will run after any data is written). The
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(the parens are not necessary here). It also wasn't completely clear to me what or where "data was written". That is possibly because I was just reading this as diff output, so maybe I lost context.

Maybe:

If a ``command`` key is present, the command will be executed after ``file`` has been populated.
The command's environment will contain the value of ``file`` specified above in the key 
``RANDOM_SEED_FILE``. If a command is specified that cannot be run, no error will 
be reported unless ``command_required`` is set to true.

@OddBloke OddBloke force-pushed the cc_seed_random branch 2 times, most recently from 1353df1 to 77366a9 Compare January 13, 2021 14:55
The documentation did not mention that the given data may not be the
exact string written: the cloud's random data may be added to it.
Additionally, the documentation of the command key was incorrect.

test_seed_random_data was updated to check that the given data is a
prefix of the written data, to match cloud-init's expected (and, now,
documented) behaviour.

LP: #1911227
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.

2 participants