2424import os
2525
2626
27- def estimate_image_size (spec = None ,sudopw = None ,padding = 200 ):
27+ def estimate_image_size (spec_file = None ,sudopw = None ,padding = 200 ):
2828 '''estimate_image_size will generate an image in a directory, and add
2929 some padding to it to estimate the size of the image file to generate
3030 :param sudopw: the sudopw for Singularity, root should provide ''
31- :param spec : the spec file, called "Singuarity"
31+ :param spec_file : the spec file, called "Singuarity"
3232 :param padding: the padding (MB) to add to the image
3333 '''
3434 size_dir = tempfile .mkdtemp ()
3535 tmp_dir = tempfile .mkdtemp ()
36- image_folder = build_from_spec (spec = spec_file , # default will package the image
36+ image_folder = build_from_spec (spec_file = spec_file , # default will package the image
3737 sudopw = sudopw , # with root should not need sudo
3838 output_folder = size_dir ,
3939 build_dir = tmp_dir ,
@@ -47,26 +47,26 @@ def estimate_image_size(spec=None,sudopw=None,padding=200):
4747 return padded_size
4848
4949
50- def build_from_spec (spec = None ,build_dir = None ,size = None ,sudopw = None ,
50+ def build_from_spec (spec_file = None ,build_dir = None ,size = None ,sudopw = None ,
5151 output_folder = None ,build_folder = False ):
5252 '''build_from_spec will build a "spec" file in a "build_dir" and return the directory
53- :param spec : the spec file, called "Singuarity"
53+ :param spec_file : the spec file, called "Singuarity"
5454 :param sudopw: the sudopw for Singularity, root should provide ''
5555 :param build_dir: the directory to build in. If not defined, will use tmpdir.
5656 :param size: the size of the image
5757 :param output_folder: where to output the image package
5858 :param build_folder: "build" the image into a folder instead. Default False
5959 '''
60- if spec == None :
61- spec = "Singularity"
60+ if spec_file == None :
61+ spec_file = "Singularity"
6262 if build_dir == None :
6363 build_dir = tempfile .mkdtemp ()
6464 bot .logger .debug ("Building in directory %s" ,build_dir )
6565
6666 # Copy the spec to a temporary directory
67- spec_path = "%s/%s" % (build_dir ,spec )
67+ spec_path = "%s/%s" % (build_dir ,spec_file )
6868 if not os .path .exists (spec_path ):
69- shutil .copyfile (spec ,spec_path )
69+ shutil .copyfile (spec_file ,spec_path )
7070 # If name isn't provided, call it Singularity
7171 image_path = "%s/image" % (build_dir )
7272 # Run create image and bootstrap with Singularity command line tool.
0 commit comments