Skip to content

Commit 8627af3

Browse files
committed
renamed lock to freeze, addressed bug detected by lemonez
1 parent d0227fc commit 8627af3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Algorithmia/CLI.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def runalgo(self, options, client):
102102
elif (options.binary_file != None):
103103
# binary file
104104
with open(options.binary_file, "rb") as f:
105-
algo_inputs = bytes(f.read())
105+
algo_input = bytes(f.read())
106106
key = self.getAPIkey(options.profile)
107107
content = 'application/octet-stream'
108108

@@ -246,7 +246,8 @@ def cat(self, path, client):
246246

247247
return result
248248

249-
def lockAlgo(self, client, manifest_path="model_manifest.json"):
249+
# algo freeze
250+
def freezeAlgo(self, client, manifest_path="model_manifest.json"):
250251
if os.path.exists(manifest_path):
251252
with open(manifest_path, 'r') as f:
252253
manifest_file = json.load(f)
@@ -265,7 +266,7 @@ def lockAlgo(self, client, manifest_path="model_manifest.json"):
265266
required_files[i]['md5_checksum'] = md5_checksum
266267
lock_md5_checksum = md5_for_str(str(manifest_file))
267268
manifest_file['lock_checksum'] = lock_md5_checksum
268-
with open('model_manifest.json.lock', 'w') as f:
269+
with open('model_manifest.json.freeze', 'w') as f:
269270
json.dump(manifest_file, f)
270271
else:
271272
print("Expected to find a model_manifest.json file, none was discovered in working directory")

Algorithmia/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def main():
130130
subparsers.add_parser('help')
131131
parser.add_argument('--profile', action = 'store', type = str, default = 'default')
132132

133-
#sub parser for lock
134-
subparsers.add_parser('lock', help="locks a model_manifest.json file into a model_manifest.json.lock")
133+
#sub parser for freeze
134+
subparsers.add_parser('freeze', help="freezes a model_manifest.json file into a model_manifest.json.freeze")
135135

136136
args = parser.parse_args()
137137

@@ -219,8 +219,8 @@ def main():
219219
elif args.cmd == 'builds':
220220
print(CLI().getBuildLogs(args.user, args.algo, client))
221221

222-
elif args.cmd == "lock":
223-
print(CLI().lockAlgo(client))
222+
elif args.cmd == "freeze":
223+
print(CLI().freezeAlgo(client))
224224

225225
else:
226226
parser.parse_args(['-h'])

0 commit comments

Comments
 (0)