Updated tzsysconfig patch
This commit is contained in:
		
							parent
							
								
									4907847669
								
							
						
					
					
						commit
						c29b44528c
					
				| @ -2,26 +2,11 @@ Index: cloud-init/cloudinit/CloudConfig/cc_timezone.py | |||||||
| ===================================================================
 | ===================================================================
 | ||||||
| --- cloud-init.orig/cloudinit/CloudConfig/cc_timezone.py
 | --- cloud-init.orig/cloudinit/CloudConfig/cc_timezone.py
 | ||||||
| +++ cloud-init/cloudinit/CloudConfig/cc_timezone.py
 | +++ cloud-init/cloudinit/CloudConfig/cc_timezone.py
 | ||||||
| @@ -38,13 +38,21 @@ def handle(name,cfg,cloud,log,args):
 | @@ -45,6 +45,13 @@ def handle(name,cfg,cloud,log,args):
 | ||||||
|          log.debug("Invalid timezone %s" % tz_file) |      except: | ||||||
|          raise Exception("Invalid timezone %s" % tz_file) |          log.debug("failed to write to /etc/timezone") | ||||||
|   |          raise | ||||||
| -    try:
 | +    if os.path.exists("/etc/sysconfig/clock"):
 | ||||||
| -        fp=open("/etc/timezone","wb")
 |  | ||||||
| -        fp.write("%s\n" % timezone)
 |  | ||||||
| -        fp.close()
 |  | ||||||
| -    except:
 |  | ||||||
| -        log.debug("failed to write to /etc/timezone")
 |  | ||||||
| -        raise
 |  | ||||||
| +    if os.path.exists("/etc/timezone"):
 |  | ||||||
| +        try:
 |  | ||||||
| +            fp=open("/etc/timezone","wb")
 |  | ||||||
| +            fp.write("%s\n" % timezone)
 |  | ||||||
| +            fp.close()
 |  | ||||||
| +        except:
 |  | ||||||
| +            log.debug("failed to write to /etc/timezone")
 |  | ||||||
| +            raise
 |  | ||||||
| +    elif os.path.exists("/etc/sysconfig/clock"):
 |  | ||||||
| +        try:
 | +        try:
 | ||||||
| +            with open("/etc/sysconfig/clock", "w") as fp:
 | +            with open("/etc/sysconfig/clock", "w") as fp:
 | ||||||
| +                fp.write('ZONE="%s"\n' % timezone)
 | +                fp.write('ZONE="%s"\n' % timezone)
 | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
| 
 | 
 | ||||||
| Name:           cloud-init | Name:           cloud-init | ||||||
| Version:        0.6.2 | Version:        0.6.2 | ||||||
| Release:        0.1.bzr450%{?dist} | Release:        0.2.bzr450%{?dist} | ||||||
| Summary:        EC2 instance init scripts | Summary:        EC2 instance init scripts | ||||||
| 
 | 
 | ||||||
| Group:          System Environment/Base | Group:          System Environment/Base | ||||||
| @ -150,5 +150,8 @@ fi | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Fri Sep 23 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.2.bzr450 | ||||||
|  | - Updated tzsysconfig patch | ||||||
|  | 
 | ||||||
| * Wed Sep 21 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.1.bzr450 | * Wed Sep 21 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.1.bzr450 | ||||||
| - Initial packaging | - Initial packaging | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user