mbligh | 6c01a5a | 2008-07-09 23:30:59 +0000 | [diff] [blame] | 1 | from autotest_lib.server import utils |
mbligh | dcd57a8 | 2007-07-11 23:06:47 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | class InstallableObject(object): |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 5 | """ |
| 6 | This class represents a software package that can be installed on |
| 7 | a Host. |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 8 | |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 9 | Implementation details: |
| 10 | This is an abstract class, leaf subclasses must implement the methods |
| 11 | listed here. You must not instantiate this class but should |
| 12 | instantiate one of those leaf subclasses. |
| 13 | """ |
mbligh | dc735a2 | 2007-08-02 16:54:37 +0000 | [diff] [blame] | 14 | |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 15 | source_material= None |
| 16 | |
| 17 | def __init__(self): |
| 18 | super(InstallableObject, self).__init__() |
| 19 | |
| 20 | |
| 21 | def get(self, location): |
| 22 | """ |
| 23 | Get the source material required to install the object. |
| 24 | |
| 25 | Through the utils.get() function, the argument passed will be |
| 26 | saved in a temporary location on the LocalHost. That location |
| 27 | is saved in the source_material attribute. |
| 28 | |
| 29 | Args: |
| 30 | location: the path to the source material. This path |
| 31 | may be of any type that the utils.get() |
| 32 | function will accept. |
| 33 | """ |
| 34 | self.source_material= utils.get(location) |
| 35 | |
| 36 | |
| 37 | def install(self, host): |
| 38 | pass |