Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • rt_decloud rt_decloud
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

En prévision de l'arrivée de la forge institutionnelle INRAE, nous vous invitons à créer vos nouveaux projets sur la forge MIA.

  • umr-tetisumr-tetis
  • rt_decloudrt_decloud
  • Merge requests
  • !7
An error occurred while fetching the assigned milestone of the selected merge_request.

FIX: follow API changes in pyotb

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Cresson Remi requested to merge 5-pyotb_update into master 2 years ago
  • Overview 0
  • Commits 11
  • Pipelines 8
  • Changes 1

Closes #5 (closed)

Viewing commit 32e949dd
Prev Next
Show latest version
1 file
+ 6
− 9

    Preferences

    File browser
    Compare changes
  • 32e949dd
    Remi Cresson
    ENH: more permissive failsafe for git · 32e949dd
    Remi Cresson authored 2 years ago
decloud/core/system.py
+ 6
− 9
  • View file @ 32e949dd

  • Edit in single-file editor

  • Open in Web IDE


@@ -41,16 +41,13 @@ def get_commit_hash():
""" Return the git hash of the repository """
repo = git.Repo(os.path.dirname(os.path.realpath(__file__)), search_parent_directories=True)
commit_hash = "nohash"
try:
commit_hash = repo.head.object.hexsha[0:5]
except (ValueError, TypeError) as e:
print(f"Unable to get commit hash! {e}")
try:
commit_hash = repo.active_branch.name + "_" + commit_hash
except (ValueError, TypeError) as e:
print(f"Unable to get branch name! {e}")
commit_hash = repo.active_branch.name + "_" + repo.head.object.hexsha[0:5]
except (TypeError, ValueError, BrokenPipeError):
try:
commit_hash = 'DETACHED_' + repo.head.object.hexsha[0:5]
except (ValueError, BrokenPipeError):
commit_hash = 'DETACHED'
return commit_hash
Assignee
Cresson Remi's avatar
Cresson Remi
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 Participants
Reference:
Source branch: 5-pyotb_update

Menu

Explore Projects Groups Topics Snippets