Ex-U.S. soldier accused of trying to join al Shabaab gets 7 years