fix nodegroup_comp func

fix bug in pull request #13587

There are function calls using getattr.
So I made some change for the same output in function nodegroup_comp.
for example
  production: 'N@web'

call function nodegroup_comp origin get "web"
after pull request #13587 get "web or "
at this version will get "web"

  production: 'N@web,N@db'

call function nodegroup_comp origin get web db
after pull request #13587 get web or db or
at this version will get web or db

So other module  which direct call the function nodegroup_comp will get correct result.

Thanks.