processing of event paths is skipped in event_server_cli

This commit is contained in:
iLLiCiTiT 2020-12-07 13:06:00 +01:00
parent 79da225622
commit db6427e07e

View file

@ -14,9 +14,13 @@ import uuid
import ftrack_api
import pymongo
from pype.modules.ftrack.lib import credentials
from pype.modules.ftrack.lib import (
credentials,
get_ftrack_url_from_settings
)
from pype.modules.ftrack.ftrack_server.lib import (
check_ftrack_url, get_ftrack_event_mongo_info
check_ftrack_url,
get_ftrack_event_mongo_info
)
import socket_thread
@ -87,25 +91,6 @@ def validate_credentials(url, user, api):
return True
def process_event_paths(event_paths):
print('DEBUG: Processing event paths: {}.'.format(str(event_paths)))
return_paths = []
not_found = []
if not event_paths:
return return_paths, not_found
if isinstance(event_paths, str):
event_paths = event_paths.split(os.pathsep)
for path in event_paths:
if os.path.exists(path):
return_paths.append(path)
else:
not_found.append(path)
return os.pathsep.join(return_paths), not_found
def legacy_server(ftrack_url):
# Current file
file_path = os.path.dirname(os.path.realpath(__file__))
@ -568,6 +553,7 @@ def main(argv):
os.environ["CLOCKIFY_API_KEY"] = kwargs.clockifyapikey
legacy = kwargs.legacy
# Check url regex and accessibility
ftrack_url = check_ftrack_url(ftrack_url)
if not ftrack_url:
@ -579,19 +565,6 @@ def main(argv):
print('Exiting! < Please enter valid credentials >')
return 1
# Process events path
event_paths, not_found = process_event_paths(event_paths)
if not_found:
print(
'WARNING: These paths were not found: {}'.format(str(not_found))
)
if not event_paths:
if not_found:
print('ERROR: Any of entered paths is valid or can be accesible.')
else:
print('ERROR: Paths to events are not set. Exiting.')
return 1
if kwargs.storecred:
credentials.save_credentials(username, api_key, ftrack_url)