Check if remote files exist before uploading
[snf-image-creator] / image_creator / dialog_menu.py
1 #!/usr/bin/env python
2
3 # Copyright 2012 GRNET S.A. All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or
6 # without modification, are permitted provided that the following
7 # conditions are met:
8 #
9 #   1. Redistributions of source code must retain the above
10 #      copyright notice, this list of conditions and the following
11 #      disclaimer.
12 #
13 #   2. Redistributions in binary form must reproduce the above
14 #      copyright notice, this list of conditions and the following
15 #      disclaimer in the documentation and/or other materials
16 #      provided with the distribution.
17 #
18 # THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
19 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
22 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
25 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
30 #
31 # The views and conclusions contained in the software and
32 # documentation are those of the authors and should not be
33 # interpreted as representing official policies, either expressed
34 # or implied, of GRNET S.A.
35
36 import os
37 import textwrap
38 import StringIO
39
40 from image_creator import __version__ as version
41 from image_creator.util import MD5
42 from image_creator.output.dialog import GaugeOutput, InfoBoxOutput
43 from image_creator.kamaki_wrapper import Kamaki, ClientError
44 from image_creator.help import get_help_file
45 from image_creator.dialog_util import SMALL_WIDTH, WIDTH, \
46     update_background_title, confirm_reset, confirm_exit, Reset, \
47     extract_image, extract_metadata_string
48
49 CONFIGURATION_TASKS = [
50     ("Partition table manipulation", ["FixPartitionTable"],
51         ["linux", "windows"]),
52     ("File system resize",
53         ["FilesystemResizeUnmounted", "FilesystemResizeMounted"],
54         ["linux", "windows"]),
55     ("Swap partition configuration", ["AddSwap"], ["linux"]),
56     ("SSH keys removal", ["DeleteSSHKeys"], ["linux"]),
57     ("Temporal RDP disabling", ["DisableRemoteDesktopConnections"],
58         ["windows"]),
59     ("SELinux relabeling at next boot", ["SELinuxAutorelabel"], ["linux"]),
60     ("Hostname/Computer Name assignment", ["AssignHostname"],
61         ["windows", "linux"]),
62     ("Password change", ["ChangePassword"], ["windows", "linux"]),
63     ("File injection", ["EnforcePersonality"], ["windows", "linux"])
64 ]
65
66
67 class MetadataMonitor(object):
68     """Monitors image metadata chages"""
69     def __init__(self, session, meta):
70         self.session = session
71         self.meta = meta
72
73     def __enter__(self):
74         self.old = {}
75         for (k, v) in self.meta.items():
76             self.old[k] = v
77
78     def __exit__(self, type, value, traceback):
79         d = self.session['dialog']
80
81         altered = {}
82         added = {}
83
84         for (k, v) in self.meta.items():
85             if k not in self.old:
86                 added[k] = v
87             elif self.old[k] != v:
88                 altered[k] = v
89
90         if not (len(added) or len(altered)):
91             return
92
93         msg = "The last action has changed some image properties:\n\n"
94         if len(added):
95             msg += "New image properties:\n"
96             for (k, v) in added.items():
97                 msg += '    %s: "%s"\n' % (k, v)
98             msg += "\n"
99         if len(altered):
100             msg += "Updated image properties:\n"
101             for (k, v) in altered.items():
102                 msg += '    %s: "%s" -> "%s"\n' % (k, self.old[k], v)
103             msg += "\n"
104
105         self.session['metadata'].update(added)
106         self.session['metadata'].update(altered)
107         d.msgbox(msg, title="Image Property Changes", width=SMALL_WIDTH)
108
109
110 def upload_image(session):
111     """Upload the image to pithos+"""
112     d = session["dialog"]
113     image = session['image']
114     meta = session['metadata']
115     size = image.size
116
117     if "account" not in session:
118         d.msgbox("You need to provide your ~okeanos credentials before you "
119                  "can upload images to pithos+", width=SMALL_WIDTH)
120         return False
121
122     while 1:
123         if 'upload' in session:
124             init = session['upload']
125         elif 'OS' in meta:
126             init = "%s.diskdump" % meta['OS']
127         else:
128             init = ""
129         (code, answer) = d.inputbox("Please provide a filename:", init=init,
130                                     width=WIDTH)
131
132         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
133             return False
134
135         filename = answer.strip()
136         if len(filename) == 0:
137             d.msgbox("Filename cannot be empty", width=SMALL_WIDTH)
138             continue
139
140         kamaki = Kamaki(session['account'], None)
141         overwrite = []
142         for f in (filename, "%s.md5sum" % filename, "%s.meta" % filename):
143             if kamaki.object_exists(f):
144                 overwrite.append(f)
145
146         if len(overwrite) > 0:
147             if d.yesno("The following pithos object(s) already exist(s):\n"
148                        "%s\nDo you want to overwrite them?" %
149                        "\n".join(overwrite), width=WIDTH, defaultno=1):
150                 continue
151
152         session['upload'] = filename
153         break
154
155     gauge = GaugeOutput(d, "Image Upload", "Uploading...")
156     try:
157         out = image.out
158         out.add(gauge)
159         kamaki.out = out
160         try:
161             if 'checksum' not in session:
162                 md5 = MD5(out)
163                 session['checksum'] = md5.compute(image.device, size)
164
165             try:
166                 # Upload image file
167                 with open(image.device, 'rb') as f:
168                     session["pithos_uri"] = \
169                         kamaki.upload(f, size, filename,
170                                       "Calculating block hashes",
171                                       "Uploading missing blocks")
172                 # Upload md5sum file
173                 out.output("Uploading md5sum file...")
174                 md5str = "%s %s\n" % (session['checksum'], filename)
175                 kamaki.upload(StringIO.StringIO(md5str), size=len(md5str),
176                               remote_path="%s.md5sum" % filename)
177                 out.success("done")
178
179             except ClientError as e:
180                 d.msgbox("Error in pithos+ client: %s" % e.message,
181                          title="Pithos+ Client Error", width=SMALL_WIDTH)
182                 if 'pithos_uri' in session:
183                     del session['pithos_uri']
184                 return False
185         finally:
186             out.remove(gauge)
187     finally:
188         gauge.cleanup()
189
190     d.msgbox("Image file `%s' was successfully uploaded to pithos+" % filename,
191              width=SMALL_WIDTH)
192
193     return True
194
195
196 def register_image(session):
197     """Register image with cyclades"""
198     d = session["dialog"]
199
200     is_public = False
201
202     if "account" not in session:
203         d.msgbox("You need to provide your ~okeanos credentians before you "
204                  "can register an images with cyclades", width=SMALL_WIDTH)
205         return False
206
207     if "pithos_uri" not in session:
208         d.msgbox("You need to upload the image to pithos+ before you can "
209                  "register it with cyclades", width=SMALL_WIDTH)
210         return False
211
212     while 1:
213         (code, answer) = d.inputbox("Please provide a registration name:",
214                                     width=WIDTH)
215         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
216             return False
217
218         name = answer.strip()
219         if len(name) == 0:
220             d.msgbox("Registration name cannot be empty", width=SMALL_WIDTH)
221             continue
222
223         ret = d.yesno("Make the image public?\\nA public image is accessible "
224                       "by every user of the service.", defaultno=1,
225                       width=WIDTH)
226         if ret not in (0, 1):
227             continue
228
229         is_public = True if ret == 0 else False
230
231         break
232
233     metadata = {}
234     metadata.update(session['metadata'])
235     if 'task_metadata' in session:
236         for key in session['task_metadata']:
237             metadata[key] = 'yes'
238
239     img_type = "public" if is_public else "private"
240     gauge = GaugeOutput(d, "Image Registration", "Registering image...")
241     try:
242         out = session['image'].out
243         out.add(gauge)
244         try:
245             try:
246                 out.output("Registering %s image with Cyclades..." % img_type)
247                 kamaki = Kamaki(session['account'], out)
248                 kamaki.register(name, session['pithos_uri'], metadata,
249                                 is_public)
250                 out.success('done')
251                 # Upload metadata file
252                 out.output("Uploading metadata file...")
253                 metastring = extract_metadata_string(session)
254                 kamaki.upload(StringIO.StringIO(metastring),
255                               size=len(metastring),
256                               remote_path="%s.meta" % session['upload'])
257                 out.success("done")
258             except ClientError as e:
259                 d.msgbox("Error in pithos+ client: %s" % e.message)
260                 return False
261         finally:
262             out.remove(gauge)
263     finally:
264         gauge.cleanup()
265
266     d.msgbox("%s image `%s' was successfully registered with Cyclades as `%s'"
267              % (img_type.title(), session['upload'], name), width=SMALL_WIDTH)
268     return True
269
270
271 def kamaki_menu(session):
272     """Show kamaki related actions"""
273     d = session['dialog']
274     default_item = "Account"
275
276     if 'account' not in session:
277         token = Kamaki.get_token()
278         if token:
279             session['account'] = Kamaki.get_account(token)
280             if not session['account']:
281                 del session['account']
282                 Kamaki.save_token('')  # The token was not valid. Remove it
283
284     while 1:
285         account = session["account"]['username'] if "account" in session else \
286             "<none>"
287         upload = session["upload"] if "upload" in session else "<none>"
288
289         choices = [("Account", "Change your ~okeanos account: %s" % account),
290                    ("Upload", "Upload image to pithos+"),
291                    ("Register", "Register the image to cyclades: %s" % upload)]
292
293         (code, choice) = d.menu(
294             text="Choose one of the following or press <Back> to go back.",
295             width=WIDTH, choices=choices, cancel="Back", height=13,
296             menu_height=5, default_item=default_item,
297             title="Image Registration Menu")
298
299         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
300             return False
301
302         if choice == "Account":
303             default_item = "Account"
304             (code, answer) = d.inputbox(
305                 "Please provide your ~okeanos authentication token:",
306                 init=session["account"]['auth_token'] if "account" in session
307                 else '', width=WIDTH)
308             if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
309                 continue
310             if len(answer) == 0 and "account" in session:
311                     del session["account"]
312             else:
313                 token = answer.strip()
314                 session['account'] = Kamaki.get_account(token)
315                 if session['account'] is not None:
316                     Kamaki.save_token(token)
317                     default_item = "Upload"
318                 else:
319                     del session['account']
320                     d.msgbox("The token you provided is not valid!",
321                              width=SMALL_WIDTH)
322         elif choice == "Upload":
323             if upload_image(session):
324                 default_item = "Register"
325             else:
326                 default_item = "Upload"
327         elif choice == "Register":
328             if register_image(session):
329                 return True
330             else:
331                 default_item = "Register"
332
333
334 def add_property(session):
335     """Add a new property to the image"""
336     d = session['dialog']
337
338     while 1:
339         (code, answer) = d.inputbox("Please provide a name for a new image"
340                                     " property:", width=WIDTH)
341         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
342             return False
343
344         name = answer.strip()
345         if len(name) == 0:
346             d.msgbox("A property name cannot be empty", width=SMALL_WIDTH)
347             continue
348
349         break
350
351     while 1:
352         (code, answer) = d.inputbox("Please provide a value for image "
353                                     "property %s" % name, width=WIDTH)
354         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
355             return False
356
357         value = answer.strip()
358         if len(value) == 0:
359             d.msgbox("Value cannot be empty", width=SMALL_WIDTH)
360             continue
361
362         break
363
364     session['metadata'][name] = value
365
366     return True
367
368
369 def modify_properties(session):
370     """Modify an existing image property"""
371     d = session['dialog']
372
373     while 1:
374         choices = []
375         for (key, val) in session['metadata'].items():
376             choices.append((str(key), str(val)))
377
378         (code, choice) = d.menu(
379             "In this menu you can edit existing image properties or add new "
380             "ones. Be careful! Most properties have special meaning and "
381             "alter the image deployment behaviour. Press <HELP> to see more "
382             "information about image properties. Press <BACK> when done.",
383             height=18, width=WIDTH, choices=choices, menu_height=10,
384             ok_label="Edit", extra_button=1, extra_label="Add", cancel="Back",
385             help_button=1, title="Image Properties")
386
387         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
388             return True
389         # Edit button
390         elif code == d.DIALOG_OK:
391             (code, answer) = d.inputbox("Please provide a new value for the "
392                                         "image property with name `%s':" %
393                                         choice,
394                                         init=session['metadata'][choice],
395                                         width=WIDTH)
396             if code not in (d.DIALOG_CANCEL, d.DIALOG_ESC):
397                 value = answer.strip()
398                 if len(value) == 0:
399                     d.msgbox("Value cannot be empty!")
400                     continue
401                 else:
402                     session['metadata'][choice] = value
403         # ADD button
404         elif code == d.DIALOG_EXTRA:
405             add_property(session)
406         elif code == 'help':
407             help_file = get_help_file("image_properties")
408             assert os.path.exists(help_file)
409             d.textbox(help_file, title="Image Properties", width=70, height=40)
410
411
412 def delete_properties(session):
413     """Delete an image property"""
414     d = session['dialog']
415
416     choices = []
417     for (key, val) in session['metadata'].items():
418         choices.append((key, "%s" % val, 0))
419
420     (code, to_delete) = d.checklist("Choose which properties to delete:",
421                                     choices=choices, width=WIDTH)
422
423     # If the user exits with ESC or CANCEL, the returned tag list is empty.
424     for i in to_delete:
425         del session['metadata'][i]
426
427     cnt = len(to_delete)
428     if cnt > 0:
429         d.msgbox("%d image properties were deleted." % cnt, width=SMALL_WIDTH)
430         return True
431     else:
432         return False
433
434
435 def exclude_tasks(session):
436     """Exclude specific tasks from running during image deployment"""
437     d = session['dialog']
438
439     index = 0
440     displayed_index = 1
441     choices = []
442     mapping = {}
443     if 'excluded_tasks' not in session:
444         session['excluded_tasks'] = []
445
446     if -1 in session['excluded_tasks']:
447         if not d.yesno("Image deployment configuration is disabled. "
448                        "Do you wish to enable it?", width=SMALL_WIDTH):
449             session['excluded_tasks'].remove(-1)
450         else:
451             return False
452
453     for (msg, task, osfamily) in CONFIGURATION_TASKS:
454         if session['metadata']['OSFAMILY'] in osfamily:
455             checked = 1 if index in session['excluded_tasks'] else 0
456             choices.append((str(displayed_index), msg, checked))
457             mapping[displayed_index] = index
458             displayed_index += 1
459         index += 1
460
461     while 1:
462         (code, tags) = d.checklist(
463             text="Please choose which configuration tasks you would like to "
464                  "prevent from running during image deployment. "
465                  "Press <No Config> to supress any configuration. "
466                  "Press <Help> for more help on the image deployment "
467                  "configuration tasks.",
468             choices=choices, height=19, list_height=8, width=WIDTH,
469             help_button=1, extra_button=1, extra_label="No Config",
470             title="Exclude Configuration Tasks")
471
472         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
473             return False
474         elif code == d.DIALOG_HELP:
475             help_file = get_help_file("configuration_tasks")
476             assert os.path.exists(help_file)
477             d.textbox(help_file, title="Configuration Tasks",
478                       width=70, height=40)
479         # No Config button
480         elif code == d.DIALOG_EXTRA:
481             session['excluded_tasks'] = [-1]
482             session['task_metadata'] = ["EXCLUDE_ALL_TASKS"]
483             break
484         elif code == d.DIALOG_OK:
485             session['excluded_tasks'] = []
486             for tag in tags:
487                 session['excluded_tasks'].append(mapping[int(tag)])
488
489             exclude_metadata = []
490             for task in session['excluded_tasks']:
491                 exclude_metadata.extend(CONFIGURATION_TASKS[task][1])
492
493             session['task_metadata'] = map(lambda x: "EXCLUDE_TASK_%s" % x,
494                                            exclude_metadata)
495             break
496
497     return True
498
499
500 def sysprep(session):
501     """Perform various system preperation tasks on the image"""
502     d = session['dialog']
503     image = session['image']
504
505     # Is the image already shrinked?
506     if 'shrinked' in session and session['shrinked']:
507         msg = "It seems you have shrinked the image. Running system " \
508               "preparation tasks on a shrinked image is dangerous."
509
510         if d.yesno("%s\n\nDo you really want to continue?" % msg,
511                    width=SMALL_WIDTH, defaultno=1):
512             return
513
514     wrapper = textwrap.TextWrapper(width=WIDTH - 5)
515
516     help_title = "System Preperation Tasks"
517     sysprep_help = "%s\n%s\n\n" % (help_title, '=' * len(help_title))
518
519     syspreps = image.os.list_syspreps()
520
521     if len(syspreps) == 0:
522         d.msgbox("No system preparation task available to run!",
523                  title="System Preperation", width=SMALL_WIDTH)
524         return
525
526     while 1:
527         choices = []
528         index = 0
529         for sysprep in syspreps:
530             name, descr = image.os.sysprep_info(sysprep)
531             display_name = name.replace('-', ' ').capitalize()
532             sysprep_help += "%s\n" % display_name
533             sysprep_help += "%s\n" % ('-' * len(display_name))
534             sysprep_help += "%s\n\n" % wrapper.fill(" ".join(descr.split()))
535             enabled = 1 if sysprep.enabled else 0
536             choices.append((str(index + 1), display_name, enabled))
537             index += 1
538
539         (code, tags) = d.checklist(
540             "Please choose which system preparation tasks you would like to "
541             "run on the image. Press <Help> to see details about the system "
542             "preparation tasks.", title="Run system preparation tasks",
543             choices=choices, width=70, ok_label="Run", help_button=1)
544
545         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
546             return False
547         elif code == d.DIALOG_HELP:
548             d.scrollbox(sysprep_help, width=WIDTH)
549         elif code == d.DIALOG_OK:
550             # Enable selected syspreps and disable the rest
551             for i in range(len(syspreps)):
552                 if str(i + 1) in tags:
553                     image.os.enable_sysprep(syspreps[i])
554                 else:
555                     image.os.disable_sysprep(syspreps[i])
556
557             if len([s for s in image.os.list_syspreps() if s.enabled]) == 0:
558                 d.msgbox("No system preperation task is selected!",
559                          title="System Preperation", width=SMALL_WIDTH)
560                 continue
561
562             infobox = InfoBoxOutput(d, "Image Configuration")
563             try:
564                 image.out.add(infobox)
565                 try:
566                     image.mount(readonly=False)
567                     try:
568                         err = "Unable to execute the system preparation " \
569                             "tasks. Couldn't mount the media%s."
570                         title = "System Preparation"
571                         if not image.mounted:
572                             d.msgbox(err % "", title=title, width=SMALL_WIDTH)
573                             return
574                         elif image.mounted_ro:
575                             d.msgbox(err % " read-write", title=title,
576                                      width=SMALL_WIDTH)
577                             return
578
579                         # The checksum is invalid. We have mounted the image rw
580                         if 'checksum' in session:
581                             del session['checksum']
582
583                         # Monitor the metadata changes during syspreps
584                         with MetadataMonitor(session, image.os.meta):
585                             image.os.do_sysprep()
586                             infobox.finalize()
587
588                     finally:
589                         image.umount()
590                 finally:
591                     image.out.remove(infobox)
592             finally:
593                 infobox.cleanup()
594             break
595     return True
596
597
598 def shrink(session):
599     """Shrink the image"""
600     d = session['dialog']
601     image = session['image']
602
603     shrinked = 'shrinked' in session and session['shrinked']
604
605     if shrinked:
606         d.msgbox("The image is already shrinked!", title="Image Shrinking",
607                  width=SMALL_WIDTH)
608         return True
609
610     msg = "This operation will shrink the last partition of the image to " \
611           "reduce the total image size. If the last partition is a swap " \
612           "partition, then this partition is removed and the partition " \
613           "before that is shrinked. The removed swap partition will be " \
614           "recreated during image deployment."
615
616     if not d.yesno("%s\n\nDo you want to continue?" % msg, width=WIDTH,
617                    height=12, title="Image Shrinking"):
618         with MetadataMonitor(session, image.meta):
619             infobox = InfoBoxOutput(d, "Image Shrinking", height=4)
620             image.out.add(infobox)
621             try:
622                 image.shrink()
623                 infobox.finalize()
624             finally:
625                 image.out.remove(infobox)
626
627         session['shrinked'] = True
628         update_background_title(session)
629     else:
630         return False
631
632     return True
633
634
635 def customization_menu(session):
636     """Show image customization menu"""
637     d = session['dialog']
638
639     choices = [("Sysprep", "Run various image preparation tasks"),
640                ("Shrink", "Shrink image"),
641                ("View/Modify", "View/Modify image properties"),
642                ("Delete", "Delete image properties"),
643                ("Exclude", "Exclude various deployment tasks from running")]
644
645     default_item = 0
646
647     actions = {"Sysprep": sysprep,
648                "Shrink": shrink,
649                "View/Modify": modify_properties,
650                "Delete": delete_properties,
651                "Exclude": exclude_tasks}
652     while 1:
653         (code, choice) = d.menu(
654             text="Choose one of the following or press <Back> to exit.",
655             width=WIDTH, choices=choices, cancel="Back", height=13,
656             menu_height=len(choices), default_item=choices[default_item][0],
657             title="Image Customization Menu")
658
659         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
660             break
661         elif choice in actions:
662             default_item = [entry[0] for entry in choices].index(choice)
663             if actions[choice](session):
664                 default_item = (default_item + 1) % len(choices)
665
666
667 def main_menu(session):
668     """Show the main menu of the program"""
669     d = session['dialog']
670
671     update_background_title(session)
672
673     choices = [("Customize", "Customize image & ~okeanos deployment options"),
674                ("Register", "Register image to ~okeanos"),
675                ("Extract", "Dump image to local file system"),
676                ("Reset", "Reset everything and start over again"),
677                ("Help", "Get help for using snf-image-creator")]
678
679     default_item = "Customize"
680
681     actions = {"Customize": customization_menu, "Register": kamaki_menu,
682                "Extract": extract_image}
683     while 1:
684         (code, choice) = d.menu(
685             text="Choose one of the following or press <Exit> to exit.",
686             width=WIDTH, choices=choices, cancel="Exit", height=13,
687             default_item=default_item, menu_height=len(choices),
688             title="Image Creator for ~okeanos (snf-image-creator version %s)" %
689                   version)
690
691         if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
692             if confirm_exit(d):
693                 break
694         elif choice == "Reset":
695             if confirm_reset(d):
696                 d.infobox("Resetting snf-image-creator. Please wait...",
697                           width=SMALL_WIDTH)
698                 raise Reset
699         elif choice == "Help":
700             d.msgbox("For help, check the online documentation:\n\nhttp://www"
701                      ".synnefo.org/docs/snf-image-creator/latest/",
702                      width=WIDTH, title="Help")
703         elif choice in actions:
704             actions[choice](session)
705
706 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :