def upload(self, user, dir_path, git_path=None):

        # Must be added to a user account
        if user == '':
            self.stdout.write("Failed: Invalid user account !!")
            return

        # verify is user account exists
        userdir = os.path.join(settings.BASE_DIR, 'data', 'users', user)
        if not os.path.exists(userdir):
            self.stdout.write("Failed: User account does not exists!!")
            return

        tempdir = None
        # if git location, first clone to local
        if git_path is not None and git_path != '':
            self.stdout.write("Git upload .. ")
            # make sure we point to some dir in git repo, bydefault root dir
            if dir_path is None:
                dir_path = ''

            # clone git repo
            git_clone_path = self.git_clone(git_path)
            if git_clone_path is None:
                self.stdout.write("Failed:  Could not clone git !!")
                return

            # build full path
            dir_path = os.path.join(git_clone_path, dir_path)
            if not os.path.exists(dir_path):
                self.stdout.write("Failed: Invalid dir within git repo !!")
                return

            # everything looks good, create a fake session and copy all yang files
            tempdir = self.dir_clone(dir_path)

            # remove git repo
            self.stdout.write("Cleaning up " + git_clone_path)
            shutil.rmtree(git_clone_path)
        elif dir_path is not None and dir_path != '':
            self.stdout.write("Local upload .. ")
            # local path, just create a fake session and copy all yang files
            tempdir = self.dir_clone(dir_path)

        if tempdir is not None:
            # finally start upload process
            self.upload_dir(user, tempdir)

            # cleanup
            self.stdout.write("Cleaning up " + tempdir)
            shutil.rmtree(tempdir)
Return a shorter version of the session ID, appropriate for
dataset/ETHPy150Open CiscoDevNet/yang-explorer/server/explorer/management/commands/bulkupload.py/Command.upload--crossover with--dataset/ETHPy150Open coreemu/core/daemon/core/session.py/Session.shortsessionid