Lab
Having covered a wide variety of functions, let’s practice using a handful of them. Let’s create a class called example_functions
that takes the parameters of the user prefix as a string and several users as an integer. This class should take two parameters: a user prefix as a string, and several users as an integer. Ensure that the prefix is in lowercase. An array of usernames should be created starting from 0
up to the number of users specified. This array should then be passed to a user resource to create the users.
Define your class with the user
string and the number 5
.
The code should also log a warning message containing text with the contents of the os.windows.product_name
fact or linux
if you’re not using a Windows machine.
Finally, the code should take the fact
path and ensure every directory is audited. Hint: you will want to separate this path into an array and pass it to a file resource. windows
and linux
use different separators for path...