File tree 3 files changed +17
-7
lines changed
3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -458,14 +458,22 @@ def __init__(
458
458
failhard (self .role )
459
459
460
460
hash_type = getattr (hashlib , self .opts .get ("hash_type" , "md5" ))
461
- # Generate full id. The full id is made from these parts name-id-env-_root.
461
+ # Generate full id.
462
462
# Full id helps decrease the chances of collections in the gitfs cache.
463
+ try :
464
+ target = str (self .get_checkout_target ())
465
+ except AttributeError :
466
+ target = ""
463
467
self ._full_id = "-" .join (
464
468
[
465
469
getattr (self , "name" , "" ),
466
- self .id . replace ( " " , "-" ) ,
470
+ self .id ,
467
471
getattr (self , "env" , "" ),
468
472
getattr (self , "_root" , "" ),
473
+ self .role ,
474
+ getattr (self , "base" , "" ),
475
+ getattr (self , "branch" , "" ),
476
+ target
469
477
]
470
478
)
471
479
# We loaded this data from yaml configuration files, so, its safe
Original file line number Diff line number Diff line change 3
3
import time
4
4
5
5
import pytest
6
+
6
7
import salt .config
7
8
import salt .fileserver .gitfs
8
9
import salt .utils .gitfs
@@ -245,7 +246,7 @@ def test_checkout_pygit2(_prepare_provider):
245
246
)
246
247
def test_full_id_pygit2 (_prepare_provider ):
247
248
assert _prepare_provider .full_id ().startswith ("-" )
248
- assert _prepare_provider .full_id ().endswith ("/pygit2-repo--" )
249
+ assert _prepare_provider .full_id ().endswith ("/pygit2-repo---gitfs-master-- " )
249
250
250
251
251
252
@pytest .mark .skipif (not HAS_PYGIT2 , reason = "This host lacks proper pygit2 support" )
Original file line number Diff line number Diff line change 6
6
import tempfile
7
7
8
8
import pytest
9
+
9
10
import salt .ext .tornado .ioloop
10
11
import salt .fileserver .gitfs
11
12
import salt .utils .files
@@ -114,23 +115,23 @@ def test_update_by_id_and_name(self):
114
115
self .assertFalse (self .main_class .remotes [1 ].fetched )
115
116
116
117
def test_full_id (self ):
117
- self .assertEqual (self .main_class .remotes [0 ].full_id (), "-file://repo1.git--" )
118
+ self .assertEqual (self .main_class .remotes [0 ].full_id (), "-file://repo1.git---gitfs-master-- " )
118
119
119
120
def test_full_id_with_name (self ):
120
121
self .assertEqual (
121
- self .main_class .remotes [1 ].full_id (), "repo2-file://repo2.git--"
122
+ self .main_class .remotes [1 ].full_id (), "repo2-file://repo2.git---gitfs-master-- "
122
123
)
123
124
124
125
def test_get_cachedir_basename (self ):
125
126
self .assertEqual (
126
127
self .main_class .remotes [0 ].get_cachedir_basename (),
127
- "-tNy9UbCHQuwj6vltGS0ptBfsE36nygwN4lFc+vbiaGA =" ,
128
+ "-jXhnbGDemchtZwTwaD2s6VOaVvs98a7w+AtiYlmOVb0 =" ,
128
129
)
129
130
130
131
def test_get_cachedir_base_with_name (self ):
131
132
self .assertEqual (
132
133
self .main_class .remotes [1 ].get_cachedir_basename (),
133
- "repo2-QhjC+OMDxuokzFQdh0jlI9W0Q8MFAXCkOhoAviU7Vqo =" ,
134
+ "repo2-nuezpiDtjQRFC0ZJDByvi+F6Vb8ZhfoH41n_KFxTGsU =" ,
134
135
)
135
136
136
137
def test_git_provider_mp_lock (self ):
You can’t perform that action at this time.
0 commit comments