Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | |
| 16 | import hashlib |
| 17 | import os |
| 18 | import socket |
| 19 | import sys |
| 20 | import base64 |
| 21 | import time |
| 22 | from xossynchronizer.steps.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible |
| 23 | from xossynchronizer.steps.syncstep import DeferredException |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 24 | |
| 25 | # hpclibrary will be in steps/.. |
| 26 | parentdir = os.path.join(os.path.dirname(__file__), "..") |
| 27 | sys.path.insert(0, parentdir) |
| 28 | |
| 29 | |
| 30 | class SyncContainer(SyncInstanceUsingAnsible): |
Scott Baker | c2fddaa | 2019-01-30 15:45:03 -0800 | [diff] [blame] | 31 | observes = "Instance" |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 32 | template_name = "sync_container.yaml" |
| 33 | |
| 34 | def __init__(self, *args, **kwargs): |
| 35 | super(SyncContainer, self).__init__(*args, **kwargs) |
| 36 | |
| 37 | def fetch_pending(self, deletion=False): |
Scott Baker | c2fddaa | 2019-01-30 15:45:03 -0800 | [diff] [blame] | 38 | i = self.model_accessor.Instance() |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 39 | i.name = "Spectacular Sponge" |
Scott Baker | c2fddaa | 2019-01-30 15:45:03 -0800 | [diff] [blame] | 40 | j = self.model_accessor.Instance() |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 41 | j.name = "Spontaneous Tent" |
Scott Baker | c2fddaa | 2019-01-30 15:45:03 -0800 | [diff] [blame] | 42 | k = self.model_accessor.Instance() |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 43 | k.name = "Embarrassed Cat" |
| 44 | |
| 45 | objs = [i, j, k] |
| 46 | return objs |
| 47 | |
| 48 | def sync_record(self, o): |
| 49 | pass |
| 50 | |
| 51 | def delete_record(self, o): |
| 52 | pass |