summaryrefslogtreecommitdiff
path: root/apexer/apex_manifest.py
diff options
context:
space:
mode:
authorAbhijeet Kaur <abkaur@google.com>2019-01-02 16:50:21 +0000
committerAbhijeet Kaur <abkaur@google.com>2019-01-02 17:00:49 +0000
commitc4b218303aead411852fe39afba916c387db6e9e (patch)
tree054b0333a7de000818342a605f3ce69e6250c5a7 /apexer/apex_manifest.py
parent4620b2d4af8f7b88802380dffe08d8bc839ec039 (diff)
apexer: Move to proto object and remove ApexManifest class
Remove ApexManifest class and use proto object directly. Add postInstallHook field in proto message schema as it is present in apexd. Bug: 116129963 Test: ./apexer/runtests.sh Change-Id: Iaca472c942c1546ff74761d450155530d446447d
Diffstat (limited to 'apexer/apex_manifest.py')
-rw-r--r--apexer/apex_manifest.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/apexer/apex_manifest.py b/apexer/apex_manifest.py
index 8bd8d75..eb9b664 100644
--- a/apexer/apex_manifest.py
+++ b/apexer/apex_manifest.py
@@ -19,17 +19,6 @@ import manifest_schema_pb2
from google.protobuf.json_format import Parse
from google.protobuf.json_format import ParseError
-class ApexManifest:
- # Default values
- package_name = ""
- version_number = 0
- preInstallHook = ""
- def __init__(self, manifest_json):
- self.package_name = manifest_json["name"]
- self.version_number = manifest_json["version"]
- if('preInstallHook' in manifest_json):
- self.preInstallHook = manifest_json["preInstallHook"]
-
class ApexManifestError(Exception):
def __init__(self, errmessage):
# Apex Manifest parse error (extra fields) or if required fields not present
@@ -46,4 +35,4 @@ def ValidateApexManifest(manifest_raw):
raise ApexManifestError("'name' field is required.")
if manifest_pb.version == 0:
raise ApexManifestError("'version' field is required.")
- return ApexManifest(manifest_json)
+ return manifest_pb