try:
snapshot = Snapshot(backenddb, base_path, obs_project=project)
+
+ # Increment snapshot
+ snapshot.inc()
+
+ # Store variables into local rather than accessing Snapshot() instance.
+ local_build_id = snapshot.build_id
+ local_targets = snapshot.targets
+ local_path = snapshot.path
+ local_dir = snapshot.dir
+
+ # Delete Snapshot() instance.
+ del snapshot
+
+ print 'We are working on:'
+ print '\t%s\n\t%s\n\t%s\n\t%s\n\n' % (local_build_id, local_targets, local_path, local_dir)
+ sys.stdout.flush()
except SnapshotError, err:
raise LocalError("Error getting snapshot info: %s" % str(err))
- # Increment snapshot
- snapshot.inc()
-
- targets = snapshot.targets
+ targets = local_targets
live_repo_path = os.path.join(live_repo_base,
project.replace(':', ':/'))
repos = {}
imagedatas = {}
if buildmonitor_enabled:
- bm_snapshot_name = snapshot.build_id
+ bm_snapshot_name = local_build_id
#buildmonitor.start_create_snapshot_for_post_build_snapshot(project,
# bm_snapshot_name,
# bm_start_datetime)
# Convert live repo to download structure
for repo in targets:
- repomaker = RepoMaker(snapshot.build_id, snapshot.path)
+ repomaker = RepoMaker(local_build_id, local_path)
# Get specific repo buildconf from OBS, put the buildconf together with
# repo-md
#buildmonitor.update_fail_create_snapshot_for_sr_stage(bm_project)
bm_stage = 'Post_Snap_Fail'
bm_data = {"bm_stage" : bm_stage,
- "bm_snapshot_name" : snapshot.build_id,
+ "bm_snapshot_name" : local_build_id,
}
trigger_next("BUILD-MONITOR-5-%s" % bm_stage, bm_data)
raise LocalError("Image configuration not found in %s" %
- snapshot.path)
+ local_path)
repos.update(repomaker.repos)
imagedatas[repo['Name']] = repomaker.imagedata
if bm_arch == 'ia32':
bm_arch = 'i686'
- bm_repo_dir = os.path.join(snapshot.path, "repos", bm_repo, "packages")
+ bm_repo_dir = os.path.join(local_path, "repos", bm_repo, "packages")
#print '[%s] snapshot.path(%s), bm_repo(%s), bm_arch(%s)\n' \
# % (__file__, snapshot.path, bm_repo, bm_arch)
#print '[%s] bm_repo_dir(%s), os.listdir(bm_repo_dir)(%s)\n' \
duplicated = set([x for x in path_list if path_list.count(x) > 1])
if len(duplicated) >= 1:
prepare_mail('error_report_manifest.env', \
- 'Snapshot %s have duplicated packages' % (snapshot.build_id), \
+ 'Snapshot %s have duplicated packages' % (local_build_id), \
'\nDuplicated items: %s' % duplicated, \
os.getenv('NOREPLY_EMAIL_SENDER'), \
os.getenv('MAILINGLIST_SYSTEM').split(','))
return {'project': project,
'repo': repos,
- 'repo_path': os.path.join(snapshot.dir, snapshot.build_id),
- 'build_id': snapshot.build_id,
+ 'repo_path': os.path.join(local_dir, local_build_id),
+ 'build_id': local_build_id,
'imagedata': imagedatas
}
except LocalError, error:
print error
sys.exit(1)
+