Skip to content

Commit

Permalink
Fixes #85 - Always respect app type defines
Browse files Browse the repository at this point in the history
  • Loading branch information
sean797 committed Jun 7, 2017
1 parent c36060a commit 551e915
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tracer/resources/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class Applications(object):
"STATIC" : "static",
"SESSION" : "session",
"APPLICATION" : "application",
"ERASED" : "erased"
"ERASED" : "erased",
"UNDEF" : "undefined" #Internal only
}
DEFAULT_TYPE = TYPES["APPLICATION"]
_apps = None
Expand All @@ -56,7 +57,7 @@ def find(app_name):
# Return the default application
return Application({
"name": app_name,
"type": Applications.DEFAULT_TYPE,
"type": Applications.TYPES["UNDEF"],
"helper": None,
"note": None,
"ignore": False,
Expand Down Expand Up @@ -196,12 +197,14 @@ def is_session(self):

@property
def type(self):
if self.is_session:
if not self._attributes["type"] == Applications.TYPES["UNDEF"]:
return self._attributes["type"]
elif self.is_session:
return Applications.TYPES["SESSION"]
elif self.is_service:
return Applications.TYPES["DAEMON"]
else:
return self._attributes["type"]
return Applications.DEFAULT_TYPE

@property
def is_service(self):
Expand Down

0 comments on commit 551e915

Please sign in to comment.