xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

With the introduction for the environment variables, not easy to compare #76

Open whowutwut opened 6 years ago

whowutwut commented 6 years ago

@immarvin I have a use case yesterday to compare a osimage definition created on an xCAT MN node to an osimage definintion that we have already put into source control

The process that I've used

  1. Export the osimage from xCAT in yaml
  2. Take the attributes and compare the various attributes to what is already in source control
xcat-inventory export -t osimage -o <osimage to compare> --format --yaml > <osimage>.yaml

So the otherpkglist looks like:

      otherpkglist:
      - /install/SHARE/ServicePack1.1_1829/custom/essl.ptf1.otherpkglist
      - /install/SHARE/ServicePack1.1_1829/custom/pessl.RC2.otherpkglist
      - /install/SHARE/ServicePack1.1_1829/custom/xlc.otherpkglist
      - /install/SHARE/ServicePack1.1_1829/custom/cuda.otherpkglist
      - /install/SHARE/ServicePack1.1_1829/custom/xlf.otherpkglist
...

At this point, I can copy and paste and look at these files and what rpms they point to and compare with what is pointed to in source control.. direct copy and paste

But when we do something like this:

      otherpkglist:
      - '{{GITREPO}}/osimage/rhels/xcat/common/cuda.otherpkglist'

I can't copy and paste it.. and cat this file easily.... do you have any suggestions, let's discuss

immarvin commented 6 years ago

hi @whowutwut , currently, if osimage.environvars contains any environment variable, xcat-inventory export will replace the attribute values with the string with the environment variables like {{GITREPO}}, I can add an option to tell xcat-inventory to disable the feature and output the raw value in xCAT DB. is it ok?

robin2008 commented 6 years ago

@whowutwut That's why we need a diff in xcat-inventory.

whowutwut commented 5 years ago

@robin2008 Sorry for the late response...

but do we really? Without the environment variable, I'm able to do what I need to do... with the environment variable, it abstracts out the info, which is why you need a diff.

If you never abstracted out, there's no need to create a diff command in xcat-inventory.

I think in this scenario, we created unnecessary work for ourselves by creating a use case that doesn't exist.

immarvin commented 5 years ago

I agree that the inventory file generated by xcat-inventory export should not contain any environment variable, while environment variable is useful for xcat-inventory import. I suggest remove the behavior of "restore" environment variable on xcat-inventory export, since it is impossible to "restore" the imported raw inventory with environment variable completely