You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/10/02 18:41:52 UTC
[22/50] [abbrv] git commit: updated refs/heads/marvin-refactor to
bbaf354
marvin_refactor: Fix marvin build and maven pom
- maven pom pointer codegenerator->xmltoapi
- regression in apidocxmlwriter fixed NPE
- fixed imports in generate module
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f8958bd1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f8958bd1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f8958bd1
Branch: refs/heads/marvin-refactor
Commit: f8958bd1ba9bcf21f36b078bbcaffd22398881c2
Parents: 0e2e5ed
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Sep 8 13:31:25 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Wed Oct 2 20:27:37 2013 +0530
----------------------------------------------------------------------
server/src/com/cloud/api/doc/ApiXmlDocWriter.java | 10 ++++++----
tools/marvin/marvin/generate/apitoentity.py | 6 +++---
tools/marvin/marvin/generate/linguist.py | 2 +-
tools/marvin/marvin/generate/xmltoapi.py | 2 +-
tools/marvin/pom.xml | 2 +-
5 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8958bd1/server/src/com/cloud/api/doc/ApiXmlDocWriter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java
index b981abb..dc3009f 100644
--- a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java
+++ b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java
@@ -608,9 +608,11 @@ public class ApiXmlDocWriter {
try {
ObjectOutputStream out = xs.createObjectOutputStream(new FileWriter(dirName + "/alert_types.xml"), "alerts");
for (Field f : AlertManager.class.getFields()) {
- String name = f.getName().substring(11);
- Alert alert = new Alert(name, f.getInt(null));
- out.writeObject(alert);
+ if (f.getClass().isAssignableFrom(Number.class)) {
+ String name = f.getName().substring(11);
+ Alert alert = new Alert(name, f.getInt(null));
+ out.writeObject(alert);
+ }
}
out.close();
} catch (IOException e) {
@@ -636,4 +638,4 @@ public class ApiXmlDocWriter {
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8958bd1/tools/marvin/marvin/generate/apitoentity.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/generate/apitoentity.py b/tools/marvin/marvin/generate/apitoentity.py
index 4a05ebf..0be5d9a 100644
--- a/tools/marvin/marvin/generate/apitoentity.py
+++ b/tools/marvin/marvin/generate/apitoentity.py
@@ -16,9 +16,9 @@
# under the License.
import os
-from marvin.generate.entity import Entity
-from marvin.generate.factory import Factory
-from marvin.generate.linguist import *
+from entity import Entity
+from factory import Factory
+from linguist import *
LICENSE = """# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8958bd1/tools/marvin/marvin/generate/linguist.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/generate/linguist.py b/tools/marvin/marvin/generate/linguist.py
index 82a7bfc..fd2729e 100644
--- a/tools/marvin/marvin/generate/linguist.py
+++ b/tools/marvin/marvin/generate/linguist.py
@@ -19,7 +19,7 @@ try:
import inflect
except ImportError:
raise Exception("inflect installation not found. use pip install inflect to continue")
-from marvin.generate.verbs import grammar
+from verbs import grammar
def singularize(word, num=0):
"""Use the inflect engine to make singular nouns of the entities
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8958bd1/tools/marvin/marvin/generate/xmltoapi.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/generate/xmltoapi.py b/tools/marvin/marvin/generate/xmltoapi.py
index 22a2786..458873a 100644
--- a/tools/marvin/marvin/generate/xmltoapi.py
+++ b/tools/marvin/marvin/generate/xmltoapi.py
@@ -23,7 +23,7 @@ import urllib2
from argparse import ArgumentParser
from textwrap import dedent
from os import path
-from marvin.generate.apitoentity import generate, get_entity_action_map
+from apitoentity import generate, get_entity_action_map
class cmdParameterProperty(object):
def __init__(self):
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8958bd1/tools/marvin/pom.xml
----------------------------------------------------------------------
diff --git a/tools/marvin/pom.xml b/tools/marvin/pom.xml
index 25909b3..872921d 100644
--- a/tools/marvin/pom.xml
+++ b/tools/marvin/pom.xml
@@ -55,7 +55,7 @@
<workingDirectory>${basedir}/marvin</workingDirectory>
<executable>python</executable>
<arguments>
- <argument>codegenerator.py</argument>
+ <argument>generate/xmltoapi.py</argument>
<argument>-s</argument>
<argument>${basedir}/commands.xml</argument>
</arguments>