loman: Fix check for existing element
When looking for an existing element, if found, the GetProject function
returns the project itself. Turns out trying to use that as a boolean
directly doesn't do what one might expect. Changing the check to see
if the main_element is None or not fixes it.
BUG=None
TEST=passed in project from manifest and it was caught correctly.
Change-Id: Id4ccee2f141e278de0d1b046572a5c9dea93099d
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/36555
Reviewed-by: Brian Harring <ferringb@chromium.org>
diff --git a/scripts/loman.py b/scripts/loman.py
index 2408eb3..3100318 100644
--- a/scripts/loman.py
+++ b/scripts/loman.py
@@ -225,7 +225,7 @@
parser.error('No project named %r in the default manifest.' % name)
_AddProjectsToManifestGroups(options, main_element.attrib['name'])
- elif main_element:
+ elif main_element is not None:
# Conflict will occur; complain.
parser.error("Requested project name=%r path=%r will conflict with "
"your current manifest %s" % (name, path, active_manifest))