Skip to content

Instantly share code, notes, and snippets.

@btm
Created December 8, 2011 17:48
Show Gist options
  • Select an option

  • Save btm/1447796 to your computer and use it in GitHub Desktop.

Select an option

Save btm/1447796 to your computer and use it in GitHub Desktop.
IRC Log of the final #chef-hacking conversions on 2009-02-09 about platform and platform_version
16:00 <@holoway> so the windows platform/platform_version stuff
16:01 < jgartrel> holoway: heya
16:01 <@holoway> one sec
16:02 < jgartrel> np
16:03 <@holoway> jgartrel: what you talked about with ben is the right thing
16:04 <@holoway> that platform is windows, platform_version is a post-processed useful version
16:06 < skeptomai> jgartrel: how are you getting the information? are you calling GetVersionEx?
16:06 < jgartrel> what is useful version ... I understand what that means for win95 family , winnt family, msdos, independently. grouping all of them together gets messy ... versions are no longer monotonically increasing
16:06 < jgartrel> http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx
16:06 < jgartrel> OSType is how Windows views the world
16:07 < skeptomai> oh geez, I think I just threw up in my mouth a little. gotcha. WMI is such a PitA
16:07 < jgartrel> yea ... but I think its the right choice for ohai
16:08 < skeptomai> better than calling GetVersionEx?
16:08 <@holoway> jgartrel: we've been sticking to 'what an administrator would call it'
16:08 <@holoway> so, 2004 RC2 SP4
16:08 <@holoway> would be totally reasonable
16:10 < jgartrel> the WMI equivalent is Win32_OperatingSystem.Version, that produces: "5.2.3790"
16:11 < jgartrel> fujin argues that this is used to determine providers
16:11 < jgartrel> if that is the case then it would be easier to use with the OStype , and Version (monotonically) increasing
16:13 < jgartrel> IMO "version": "Microsoft(R) Windows(R) Server 2003 Service Pack 2 Build 3790", is just icky
16:13 <@holoway> right
16:13 < jgartrel> err forgot the R2
16:13 <@holoway> but
16:13 <@holoway> platform = windows
16:14 < danglies_> that's why it is in kernel[:version]
16:14 <@holoway> platform_value = server 2003 sp2
16:14 < danglies_> not in the common use stuff
16:14 < danglies_> platform_version
16:14 <@holoway> s/value/version/g
16:14 <@holoway> and the full unadulterated chaos in the kernel namespace
16:16 < jgartrel> im with you but how does that help to choose providers .... its also like calling Solaris SunOS , there is a differentiator in the windows world
16:16 < jgartrel> what about windows CE?
16:16 < jgartrel> is that "Windows CE" and version "bar"
16:16 <@holoway> jgartrel: you choose providers as the mix of both platform and platform_version
16:16 -!- danglies [n=bb@75-92-176-71.sea.clearwire-dns.net] has quit [Read error: 110 (Connection timed out)]
16:17 <@holoway> I could see an easy case for windows ce being a different platform than windows
16:17 -!- danglies_ is now known as danglies
16:18 < jgartrel> then windows 95 should be a difffent platform and sow should windows NT and so should the original windows IMHO
16:18 < danglies> we are not going to deal with pre-3.51
16:18 < danglies> it is a non-issue
16:18 < danglies> we could even just say nothing pre 5
16:18 < jgartrel> Just because MS is stupid with naming doesnt mean we have to be
16:18 < jgartrel> We dont call redhat ... Linux
16:19 <@holoway> right
16:19 < danglies> yes we do
16:19 < jgartrel> or SunOS BSD
16:19 < danglies> AND redhat
16:19 <@holoway> well, in the knerel stuff we do
16:19 <@holoway> but the platform and platform_version is redhat/ubuntu/sles/etc
16:19 < danglies> jgartrel: there is no pre-solaris2 support
16:19 < danglies> which is what we should do here
16:19 < danglies> no pre v5 kernel for windows
16:20 <@holoway> jgartrel: do you have a use case to go back that far? I mean, even getting ruby running on those platforms would be a feat
16:20 < jgartrel> if you want to make a call that there is no pre NT kernel then "Windows" == "Windows NT" and there is no issue
16:20 < danglies> correct
16:20 < danglies> hence
16:20 < danglies> platform: windows
16:21 <@holoway> and if some poor soul manges to get the whole stack running on windows 95 or 98, we'll cross that bridge
16:21 <@holoway> but seeing as how they are end of lifed by microsoft
16:21 <@holoway> not a huge deal
16:22 < jgartrel> then that is fine with me :-D
16:22 < jgartrel> should platform versoin be : "5.2.3790"
16:22 < jgartrel> or "5.2.3790 Service Pack 2 Build 3790"
16:22 < danglies> or Server 2003 R2 SP2 ;)
16:22 < danglies> so many choices, thanks microsoft!
16:23 < jgartrel> I vote for "5.2.3790"
16:23 < jgartrel> all other platform versions seem to be "x.x.x"
16:24 < jgartrel> and not have extraneous text
16:25 < danglies> sounds right
16:25 < btm> I still argue that violates "what the administrator calls it" and that should be somewhere other than platform_version.
16:25 < danglies> if they need the "human" version, they can look in kernel[]
16:25 <@holoway> btm: kind of - one issue
16:25 < btm> danglies: every where else it's the other way around though.
16:25 <@holoway> is that lets say you wanted to hit all the service packs on a given thing
16:25 < danglies> btm: hard to reconcile with the rather verbose naming microsoft uses
16:25 < jgartrel> and what should kernel[:os] be? ("WINNT", "Microsoft(R) Windows(R) Server 2003, Datacenter x64 Edition", or something else?)
16:26 < danglies> btm: windows is backwards. again.
16:26 <@holoway> if you think about it in code
16:26 <@holoway> it's a > vs a regex
16:26 <@holoway> and for things like ubuntu
16:26 <@holoway> we totally use the version number, not the code name
16:27 <@holoway> which you could easily argue is what windows 2003 rc2 sp4 really is - the code name
16:27 < btm> because we're lazy and want that numerical compare, but people still call intrepid 8.10.
16:27 <@holoway> btm: Debian is a better example - everyone always uses the code names
16:27 <@holoway> but ohai still makes it 4
16:28 -!- jesserobbins [n=jesserob@72-62-255-107.pools.spcsdns.net] has quit []
16:28 < btm> but that's not to say in code you can't check > against kernel[:some other crap] but I agree using a single number fits making platform_version simple.
16:28 < btm> provided that's available across xp -> 7 in a way that makes sense.
16:29 <@holoway> I think XP is fine
16:29 <@holoway> because it has the NT versioning scheme
16:29 <@holoway> down in it's bowels
16:33 -!- ezmobius [n=ezmobius@208.80.65.98] has quit ["Bye!"]
16:36 < jgartrel> it does have a 5.x.x version number
16:36 < jgartrel> 5.1.2600.5512
16:37 < jgartrel> where 5512 is the build number
16:37 < jgartrel> I do believe
16:38 < jgartrel> getversion would produce 5.1.2600 per memory
16:38 < jgartrel> my memory that is
16:39 < jgartrel> What should kernel[:os] be? ("WINNT", "Microsoft(R) Windows(R) Server 2003, Datacenter x64 Edition", or something else?)
16:41 < skeptomai> jgartrel: and if you include those, it gets worse. What about Windows Storage Server or Windows Home Server? Those can be differentiated in the SuiteMask if anyone cares about them
16:41 < jgartrel> Im guessing kernel[:name] should be "Microsoft(R) Windows(R) Server 2003, Datacenter x64 Edition", and kernel[:os] should be "WINNT"
16:41 < jgartrel> I dont care about those ... those should can be parsed as necessary
16:42 < jgartrel> Kernel version should probably look like ... "version": "5.2.3790 Service Pack 2 Build 3790"
16:43 < jgartrel> kernel[:release] should be the same as platform[:version] ... "5.2.3790"
16:43 < jgartrel> any objections to all of that?
16:43 < btm> I think that's right. although duplicate attributes is silly and mocks us, but whutevs.
16:45 < jgartrel> I might create another var for R2 like ... "other_type_description" : "R2"
16:45 <@holoway> jgartrel: easiest thing to do from here is to have you just do it - the thing that really mattered was that platform_version is that number
16:45 <@holoway> everything else you should just do what you think is best
16:45 <@holoway> and when people start using it, we'll refactor
16:45 <@holoway> :)
16:46 < jgartrel> will do ... everything else is set on the branch , I will make the platform name change to "Windows" tonight
16:47 <@holoway> should be 'windows'
16:47 <@holoway> no capitals
16:47 < jgartrel> ;-) K
16:47 <@holoway> jgartrel: ydm
16:47 <@holoway> rock on with your bad windows self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment