Skip to content

Commit

Permalink
update repo validation per cmdl servers/clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
abdul committed Apr 16, 2015
1 parent a8a0aea commit 9eff599
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mongoctl/repository.py
Expand Up @@ -79,6 +79,11 @@ def has_db_repository():
def has_file_repository():
return config.get_file_repository_conf() is not None

###############################################################################
def has_commandline_servers_or_clusters():
global __commandline_clusters__, __commandline_servers__
return __commandline_clusters__ or __commandline_servers__

###############################################################################
def consulting_db_repository():
return has_db_repository() and is_db_repository_online()
Expand All @@ -100,8 +105,7 @@ def _db_repo_connect():

###############################################################################
def validate_repositories():
if ((not has_file_repository()) and
(not has_db_repository())):
if not(has_file_repository() or has_db_repository() or has_commandline_servers_or_clusters()):
raise MongoctlException("Invalid 'mongoctl.config': No fileRepository"
" or databaseRepository configured. At least"
" one repository has to be configured.")
Expand Down

0 comments on commit 9eff599

Please sign in to comment.