Skip to content

Commit

Permalink
Removed username validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Abarca committed Jun 11, 2024
1 parent e446c03 commit 3fcdfa0
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ public void handle(NodeEntryImpl node, Map<String, Object> tags) throws Resource
},
USERNAME {
@Override
public void handle(NodeEntryImpl node, Map<String, Object> tags) throws ResourceModelSourceException {
public void handle(NodeEntryImpl node, Map<String, Object> tags) {
final List<String> usernames = List.of("username", "ansible_user", "ansible_ssh_user", "ansible_user_id");
String nameTag = InventoryList.findTag(usernames, tags);
node.setUsername(Optional.ofNullable(nameTag)
.orElseThrow(() -> new ResourceModelSourceException(format(ERROR_MISSING_TAG, usernames))));
Optional.ofNullable(nameTag).ifPresent(node::setUsername);
}
},
OS_FAMILY {
Expand Down

0 comments on commit 3fcdfa0

Please sign in to comment.