Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.

Copy jRuby users/groups script to new projects one #1259

Merged
merged 2 commits into from
Aug 10, 2018

Conversation

vt0r
Copy link
Member

@vt0r vt0r commented Aug 10, 2018

For now, this is duplication. The intent is to extend this newer version to support the user/groups directory creation the original is currently doing, bringing the number of jRuby scripts back down to the desired number (1).

Copy link
Contributor

@macmaster macmaster left a comment

Choose a reason for hiding this comment

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

Looks good. I'll open an issue to refactor the user and group dir creation to use one master dir_creation routine based on this one.

ns_quota =
info['ns_quota'] ||
node['bcpc']['hadoop']['hdfs']['projects']['ns_quota']
[
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can cut out some redundancy here.

dirinfo_hash = dirinfo.map do |dir, info|
  [ dir, {
    'owner' => info['owner'] ||
      node['bcpc']['hadoop']['hdfs']['projects']['owner'],
    'group' => info['group'] ||
      node['bcpc']['hadoop']['hdfs']['projects']['group'],
    'perms' => info['perms'] ||
      node['bcpc']['hadoop']['hdfs']['projects']['perms'],
    'space_quota' => info['space_quota'] ||
      node['bcpc']['hadoop']['hdfs']['projects']['space_quota'],
    'ns_quota' => info['ns_quota'] ||
      node['bcpc']['hadoop']['hdfs']['projects']['ns_quota']
   } ] 
end.to_h

Also, the reason we needed to use symbols in the jruby script is because we used symbol keys for the hash here.
We could stay consistent by using string keys here.

Copy link
Collaborator

@aespinosa aespinosa left a comment

Choose a reason for hiding this comment

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

lgtm

@aespinosa aespinosa merged commit 402b01f into bloomberg:master Aug 10, 2018
vt0r added a commit that referenced this pull request Aug 10, 2018
* Copy jRuby users/groups script to new projects one

* Cleanup on dirinfo_hash assignments - feedback

(cherry picked from commit 402b01f)
@vt0r vt0r deleted the projects_to_jruby branch October 24, 2018 22:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants