> Surely WriteMetadata would take the metadataInfo as an input
parameter?
The sematics of the write function is to take a ImageMetadata struct and
write out the simplestreams metadata. In order to write the metadata, it
needs to be generated from the struct. The method could be called
WriteAndGenerate I guess. But the generation and writing to file is an
atomic operation.
A subsequent branch renames the method anyway and refactors the content
to align with what Andrew did for tools metadata.
Tells json not to marshall that attribute. It's there to provide info
for other mthods in the struct to do their thing, but we don't want it
serialised to json.
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ generate. go imagemetadata/ generate. go (right):
File environs/
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ generate. go#newcode15 imagemetadata/ generate. go:15: metadataInfo, err := a(series, im, cloudSpec)
environs/
generateMetadat
On 2013/10/16 01:26:11, thumper wrote:
> This has me queezy.
> Surely WriteMetadata would take the metadataInfo as an input
parameter?
The sematics of the write function is to take a ImageMetadata struct and
write out the simplestreams metadata. In order to write the metadata, it
needs to be generated from the struct. The method could be called
WriteAndGenerate I guess. But the generation and writing to file is an
atomic operation.
A subsequent branch renames the method anyway and refactors the content
to align with what Andrew did for tools metadata.
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ generate_ test.go imagemetadata/ generate_ test.go (right):
File environs/
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ generate_ test.go# newcode17 imagemetadata/ generate_ test.go: 17: type generateSuite struct{} LoggingSuite
environs/
On 2013/10/16 01:26:11, thumper wrote:
> testbase.
Will fix
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ generate_ test.go# newcode34 imagemetadata/ generate_ test.go: 34: c.Assert( len(metadata) ,
environs/
gc.Equals, 1)
On 2013/10/16 01:26:11, thumper wrote:
> gc.HasLen
Will fix
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ simplestreams. go imagemetadata/ simplestreams. go (right):
File environs/
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ imagemetadata/ simplestreams. go#newcode121 imagemetadata/ simplestreams. go:121: Release string
environs/
`json:"-"`
On 2013/10/16 01:26:11, thumper wrote:
> What does json:"-" do?
Tells json not to marshall that attribute. It's there to provide info
for other mthods in the struct to do their thing, but we don't want it
serialised to json.
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ tools/marshal. go tools/marshal. go (right):
File environs/
https:/ /codereview. appspot. com/14540055/ diff/4001/ environs/ tools/marshal. go#newcode69 tools/marshal. go:69: itemsversion := updated. Format( "20060102" )
environs/
// YYYYMMDD
On 2013/10/16 01:26:11, thumper wrote:
> Some of these changes are the same as the branch I just reviewed.
I fixed this in a downstream branch - I didn't pump the changes back up
the pipe sorry.
https:/ /codereview. appspot. com/14540055/