You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repo: Repository.targets.add_target unexpected behavior implied in walkthrough #319
>>> repository.targets.add_target(target3_filepath, custom_file_permissions)
# Individual target files may also be added to roles, including custom data about the target.
# In the example below, file permissions of the target (octal number specifying file
# access for owner, group, others (e.g., 0755) is added alongside the default fileinfo.
# All target objects in metadata include the target's filepath, hash, and length.
>>> target3_filepath = "/path/to/repository/targets/file3.txt"
>>> octal_file_permissions = oct(os.stat(target3_filepath).st_mode)[4:]
>>> custom_file_permissions = {'file_permissions': octal_file_permissions}
>>> repository.targets.add_target(target3_filepath, custom_file_permissions)
The walkthrough instructs you to create a custom field for a target and add that target with the custom field. This target has already been added, though, in the walkthrough, and adding it again actually fails to incorporate the custom field. The user is not given a step showing them the result, either, so it leads the user to walk away thinking that the way to add custom fields to an existing target is to simply add the already-existing target back again with the custom field.
Either it actually is the expected behavior that re-adding replaces, and the behavior needs to be corrected (to replace an existing target when it is added again), or
The instructions should refer to a fresh target instead of an existing target, and, further, a warning should be added when a user attempts to add a target that already exists indicating that the command had no impact.
changed the title [-]Repository.targets.add_target unexpected behavior implied in walkthrough[/-][+]Repo: Repository.targets.add_target unexpected behavior implied in walkthrough[/+]on Feb 29, 2016
Activity
[-]Repository.targets.add_target unexpected behavior implied in walkthrough[/-][+]Repo: Repository.targets.add_target unexpected behavior implied in walkthrough[/+]vladimir-v-diaz commentedon Nov 10, 2016
This issue appears to be fixed in the latest "develop" branch:
vladimir-v-diaz commentedon Nov 10, 2016
Reopening. I need to verify the case for a replaced target path!
Allow an already added target to be replaced in repository.add_target()
Add a test condition for the previously added feature for issue #319
vladimir-v-diaz commentedon Nov 10, 2016
This issue should now be fixed in #403. Note how the
file2.txtentry is replaced.