Permalink
Browse files

TOOLS-159: Add description field

  • Loading branch information...
1 parent 6816926 commit 476bf5fa2853e69827ac4c6c0267841562164d82 @orlandov orlandov committed Aug 7, 2012
Showing with 20 additions and 4 deletions.
  1. +10 −2 lib/cli.js
  2. +10 −2 lib/dataset_manifest.js
View
@@ -65,6 +65,10 @@ CLI.prototype.parseOptions = function () {
options.ds_name = value;
});
+ parser.on('ds-description', function (name, value) {
+ options.ds_description = value;
+ });
+
parser.on('ds-version', function (name, value) {
options.ds_version = value;
});
@@ -170,7 +174,8 @@ CLI.prototype.parseOvfFile = function (callback) {
CLI.prototype.writeDatasetManifest = function (callback) {
var self = this;
var dsmfilename
- = path.join(self.options.outputDir, self.manifest.name) + '.dsmanifest';
+ = path.join(
+ self.options.outputDir, self.manifest.name) + '.dsmanifest';
console.log(dsmfilename);
fs.writeFile(
dsmfilename,
@@ -220,10 +225,13 @@ CLI.prototype.createDatasetManifest = function (callback) {
var VirtualSystem = ovf.VirtualSystem;
manifest.name = this.options.ds_name || VirtualSystem['@']['ovf:id'];
+ manifest.version = this.options.ds_version || '1.0.0';
+ manifest.description
+ = this.options.ds_description ||
+ manifest.name + ' ' + manifest.version;
manifest.requirements = {};
manifest.type = 'zvol';
manifest.uuid = this.options.ds_uuid || uuid().toLowerCase();
- manifest.version = this.options.ds_version || '1.0.0';
manifest.os = this.options.ds_os || manifest.name;
manifest.disk_driver = this.options.disk_driver || 'virtio';
manifest.nic_driver = this.options.nic_driver || 'virtio';
View
@@ -1,8 +1,16 @@
var DatasetManifest = module.exports = function () {
var self = this;
var simpleKeys = [
- 'name', 'type', 'uuid', 'version', 'image_size', 'files', 'os',
- 'disk_driver', 'nic_driver'
+ 'name',
+ 'type',
+ 'uuid',
+ 'version',
+ 'image_size',
+ 'files',
+ 'os',
+ 'disk_driver',
+ 'nic_driver',
+ 'description'
];
this.manifest = { files: [], requirements: { networks : [] }};

0 comments on commit 476bf5f

Please sign in to comment.